import{computed as c,inject as Ne,defineComponent as ue,createElementBlock as i,openBlock as a,mergeProps as Ce,withModifiers as He,renderSlot as O,ref as A,shallowRef as Zl,unref as G,isRef as en,nextTick as wt,provide as ul,watchEffect as Cl,normalizeClass as g,createElementVNode as s,createCommentVNode as x,toDisplayString as T,h as St,resolveComponent as U,createBlock as X,withCtx as we,useAttrs as ca,createVNode as pe,createTextVNode as he,normalizeStyle as is,createStaticVNode as Sl,Fragment as Ve,renderList as Se,withDirectives as Pt,vModelCheckbox as rs,withKeys as tn,vModelSelect as fa,markRaw as va,useSlots as Tl,getCurrentInstance as Pe,onMounted as tt,createSlots as us,normalizeProps as $l,guardReactiveProps as ln,vModelDynamic as ma,onUnmounted as jt,watch as kt,vModelText as ga,resolveDynamicComponent as sn,resolveDirective as pa}from"vue";import{lastRightPart as Dt,leftPart as Fl,map as Ee,toDate as gt,mapGet as ye,toCamelCase as ya,toDateTime as ha,chop as ba,isDate as Al,dateFmt as wa,fromXsdDuration as nn,timeFmt12 as xa,omit as ft,appendQueryString as Zt,indexOfAny as ka,apiValue as Ca,enc as Wl,createBus as $a,toKebabCase as Qs,ApiResult as Ge,nameOf as La,lastLeftPart as an,setQueryString as Va,toTime as Ma,ResponseStatus as Ql,ResponseError as Ks,sanitize as Sa,errorResponseExcept as Ta,humanize as De,delaySet as on,rightPart as bl,queryString as Gl,combinePaths as Fa,toPascalCase as ut,errorResponse as pt,trimEnd as Aa,$1 as Ll,HttpMethods as ds,omitEmpty as Ia,uniqueKeys as Jl,humanify as rn,each as Pa}from"@servicestack/client";let un="png,jpg,jpeg,jfif,gif,svg,webp".split(","),dn={img:"png,jpg,jpeg,gif,svg,webp,png,jpg,jpeg,gif,bmp,tif,tiff,webp,ai,psd,ps".split(","),vid:"avi,m4v,mov,mp4,mpg,mpeg,wmv,webm".split(","),aud:"mp3,mpa,ogg,wav,wma,mid,webm".split(","),ppt:"key,odp,pps,ppt,pptx".split(","),xls:"xls,xlsm,xlsx,ods,csv,tsv".split(","),doc:"doc,docx,pdf,rtf,tex,txt,md,rst,xls,xlsm,xlsx,ods,key,odp,pps,ppt,pptx".split(","),zip:"zip,tar,gz,7z,rar,gzip,deflate,br,iso,dmg,z,lz,lz4,lzh,s7z,apl,arg,jar,war".split(","),exe:"exe,bat,sh,cmd,com,app,msi,run,vb,vbs,js,ws,wsh".split(","),att:"bin,oct,dat".split(",")},_s=Object.keys(dn),mt=(e,t)=>`<svg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' role='img' preserveAspectRatio='xMidYMid meet' viewBox='${e}'>${t}</svg>`,wl={img:mt("4 4 16 16","<path fill='currentColor' d='M20 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2zm-2 0H6v6.38l2.19-2.19l5.23 5.23l1-1a1.59 1.59 0 0 1 2.11.11L18 16V6zm-5 3.5a1.5 1.5 0 1 1 3 0a1.5 1.5 0 0 1-3 0z'/>"),vid:mt("0 0 24 24","<path fill='currentColor' d='m14 2l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8m4 18V9h-5V4H6v16h12m-2-2l-2.5-1.7V18H8v-5h5.5v1.7L16 13v5Z'/>"),aud:mt("0 0 24 24","<path fill='currentColor' d='M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6zm10-9h-4v3.88a2.247 2.247 0 0 0-3.5 1.87c0 1.24 1.01 2.25 2.25 2.25S13 17.99 13 16.75V13h3v-2z'/>"),ppt:mt("0 0 48 48","<g fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='4'><path d='M4 8h40'/><path d='M8 8h32v26H8V8Z' clip-rule='evenodd'/><path d='m22 16l5 5l-5 5m-6 16l8-8l8 8'/></g>"),xls:mt("0 0 256 256","<path fill='currentColor' d='M200 26H72a14 14 0 0 0-14 14v26H40a14 14 0 0 0-14 14v96a14 14 0 0 0 14 14h18v26a14 14 0 0 0 14 14h128a14 14 0 0 0 14-14V40a14 14 0 0 0-14-14Zm-42 76h44v52h-44Zm44-62v50h-44V80a14 14 0 0 0-14-14h-2V38h58a2 2 0 0 1 2 2ZM70 40a2 2 0 0 1 2-2h58v28H70ZM38 176V80a2 2 0 0 1 2-2h104a2 2 0 0 1 2 2v96a2 2 0 0 1-2 2H40a2 2 0 0 1-2-2Zm32 40v-26h60v28H72a2 2 0 0 1-2-2Zm130 2h-58v-28h2a14 14 0 0 0 14-14v-10h44v50a2 2 0 0 1-2 2ZM69.2 148.4L84.5 128l-15.3-20.4a6 6 0 1 1 9.6-7.2L92 118l13.2-17.6a6 6 0 0 1 9.6 7.2L99.5 128l15.3 20.4a6 6 0 0 1-9.6 7.2L92 138l-13.2 17.6a6 6 0 1 1-9.6-7.2Z'/>"),doc:mt("0 0 32 32","<path fill='currentColor' d='M26 30H11a2.002 2.002 0 0 1-2-2v-6h2v6h15V6h-9V4h9a2.002 2.002 0 0 1 2 2v22a2.002 2.002 0 0 1-2 2Z'/><path fill='currentColor' d='M17 10h7v2h-7zm-1 5h8v2h-8zm-1 5h9v2h-9zm-6-1a5.005 5.005 0 0 1-5-5V3h2v11a3 3 0 0 0 6 0V5a1 1 0 0 0-2 0v10H8V5a3 3 0 0 1 6 0v9a5.005 5.005 0 0 1-5 5z'/>"),zip:mt("0 0 16 16","<g fill='currentColor'><path d='M6.5 7.5a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v.938l.4 1.599a1 1 0 0 1-.416 1.074l-.93.62a1 1 0 0 1-1.109 0l-.93-.62a1 1 0 0 1-.415-1.074l.4-1.599V7.5zm2 0h-1v.938a1 1 0 0 1-.03.243l-.4 1.598l.93.62l.93-.62l-.4-1.598a1 1 0 0 1-.03-.243V7.5z'/><path d='M2 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2zm5.5-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H9v1H8v1h1v1H8v1h1v1H7.5V5h-1V4h1V3h-1V2h1V1z'/></g>"),exe:mt("0 0 16 16","<path fill='currentColor' fill-rule='evenodd' d='M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM2.575 15.202H.785v-1.073H2.47v-.606H.785v-1.025h1.79v-.648H0v3.999h2.575v-.647ZM6.31 11.85h-.893l-.823 1.439h-.036l-.832-1.439h-.931l1.227 1.983l-1.239 2.016h.861l.853-1.415h.035l.85 1.415h.908l-1.254-1.992L6.31 11.85Zm1.025 3.352h1.79v.647H6.548V11.85h2.576v.648h-1.79v1.025h1.684v.606H7.334v1.073Z'/>"),att:mt("0 0 24 24","<path fill='currentColor' d='M14 0a5 5 0 0 1 5 5v12a7 7 0 1 1-14 0V9h2v8a5 5 0 0 0 10 0V5a3 3 0 1 0-6 0v12a1 1 0 1 0 2 0V6h2v11a3 3 0 1 1-6 0V5a5 5 0 0 1 5-5Z'/>")},Da=/[\r\n%#()<>?[\\\]^`{|}]/g,Zs=1024,Ba=["Bytes","KB","MB","GB","TB"],ja=(()=>{let t="application/",e=t+"vnd.openxmlformats-officedocument.",a="image/",l="text/",s="audio/",r="video/",n={jpg:a+"jpeg",tif:a+"tiff",svg:a+"svg+xml",ico:a+"x-icon",ts:l+"typescript",py:l+"x-python",sh:l+"x-sh",mp3:s+"mpeg3",mpg:r+"mpeg",ogv:r+"ogg",xlsx:e+"spreadsheetml.sheet",xltx:e+"spreadsheetml.template",docx:e+"wordprocessingml.document",dotx:e+"wordprocessingml.template",pptx:e+"presentationml.presentation",potx:e+"presentationml.template",ppsx:e+"presentationml.slideshow",mdb:t+"vnd.ms-access"};function o(e,t){e.split(",").forEach(e=>n[e]=t)}function i(e,t){e.split(",").forEach(e=>n[e]=t(e))}return i("jpeg,gif,png,tiff,bmp,webp",e=>a+e),i("jsx,csv,css",e=>l+e),i("aac,ac3,aiff,m4a,m4b,m4p,mid,midi,wav",e=>s+e),i("3gpp,avi,dv,divx,ogg,mp4,webm",e=>r+e),i("rtf,pdf",e=>t+e),o("htm,html,shtm",l+"html"),o("js,mjs,cjs",l+"javascript"),o("yml,yaml",t+"yaml"),o("bat,cmd",t+"bat"),o("xml,csproj,fsproj,vbproj",l+"xml"),o("txt,ps1",l+"plain"),o("qt,mov",r+"quicktime"),o("doc,dot",t+"msword"),o("xls,xlt,xla",t+"excel"),o("ppt,oit,pps,ppa",t+"vnd.ms-powerpoint"),o("cer,crt,der",t+"x-x509-ca-cert"),o("gz,tgz,zip,rar,lzh,z",t+"x-compressed"),o("aaf,aca,asd,bin,cab,chm,class,cur,db,dat,deploy,dll,dsp,exe,fla,ics,inf,mix,msi,mso,obj,ocx,prm,prx,psd,psp,qxd,sea,snp,so,sqlite,toc,ttf,u32,xmp,xsn,xtp",t+"octet-stream"),n})(),Xl=[];function cn(e){return(e=(e=(e=e.replace(/"/g,"'")).replace(/>\s+</g,"><")).replace(/\s{2,}/g," ")).replace(Da,encodeURIComponent)}function cs(e){return"data:image/svg+xml;utf8,"+cn(e)}function fn(e){var t=URL.createObjectURL(e);return Xl.push(t),t}function vn(){Xl.forEach(e=>{try{URL.revokeObjectURL(e)}catch(e){console.error("URL.revokeObjectURL",e)}}),Xl=[]}function fs(e){var t;return e?(t=Fl(e,"?"),Dt(t,"/")):null}function dl(e){var t=fs(e);return null==t||-1===t.indexOf(".")?null:Dt(t,".").toLowerCase()}function vs(e){var t=dl(e.name);return t&&0<=un.indexOf(t)?fn(e):Tt(e.name)}function ms(e){var t;return e&&(!(!e.startsWith("blob:")&&!e.startsWith("data:"))||(t=dl(e))&&0<=un.indexOf(t))||!1}function Tt(e){var t;return e?null==(t=dl(e))||ms(e)?e:ll(t)||cs(wl.doc):null}function ll(e){var t=mn(e);return t&&cs(t)||null}function mn(e){if(wl[e])return wl[e];for(let a=0;a<_s.length;a++){var t=_s[a];if(0<=dn[t].indexOf(e))return wl[t]}return null}function gs(e,t=2){var a,l;return 0===e?"0 Bytes":(a=t<0?0:t,l=Math.floor(Math.log(e)/Math.log(Zs)),parseFloat((e/Math.pow(Zs,l)).toFixed(a))+" "+Ba[l])}function Oa(e){return e.files&&Array.from(e.files).map(e=>({fileName:e.name,contentLength:e.size,filePath:vs(e)}))}function Il(e,t){e.onerror=null,e.src=ps(e.src,t)||""}function ps(e,t){return ll(Dt(e,".").toLowerCase())||(t?ll(t)||t:null)||ll("doc")}function Yl(e){var t;if(e)return t=Dt(e,".").toLowerCase(),ja[t]||"application/"+t;throw new Error("fileNameOrExt required")}function Ha(){return{extSvg:mn,extSrc:ll,getExt:dl,encodeSvg:cn,canPreview:ms,getFileName:fs,getMimeType:Yl,formatBytes:gs,filePathUri:Tt,svgToDataUri:cs,fileImageUri:vs,objectUrl:fn,flush:vn,inputFiles:Oa,iconOnError:Il,iconFallbackSrc:ps}}class Ra{view;includeTypes;constructor(e){Object.assign(this,e)}getTypeName(){return"MetadataApp"}getMethod(){return"GET"}createResponse(){return{}}}let Wt="/metadata/app.json",Ea={Boolean:"checkbox",DateTime:"date",DateOnly:"date",DateTimeOffset:"date",TimeSpan:"time",TimeOnly:"time",Byte:"number",Short:"number",Int64:"number",Int32:"number",UInt16:"number",UInt32:"number",UInt64:"number",Single:"number",Double:"number",Decimal:"number",String:"text",Guid:"text",Uri:"text"},Na={number:"Int32",checkbox:"Boolean",date:"DateTime","datetime-local":"DateTime",time:"TimeSpan"},es={Byte:"byte",Int16:"short",Int32:"int",Int64:"long",UInt16:"ushort",Unt32:"uint",UInt64:"ulong",Single:"float",Double:"double",Decimal:"decimal"},za=([...Object.keys(es),...Object.values(es)],{String:"string",Boolean:"bool",...es});function pl(e){return za[e]||e}function gn(e,t){return e?(t=t||[],"Nullable`1"===e?pl(t[0])+"?":e.endsWith("[]")?`List<${pl(e.substring(0,e.length-2))}>`:0===t.length?pl(e):Fl(pl(e),"`")+"<"+t.join(",")+">"):""}function Ua(e){return e&&gn(e.name,e.genericArgs)}class bt{Query;QueryInto;Create;Update;Patch;Delete;get AnyQuery(){return this.Query||this.QueryInto}get AnyUpdate(){return this.Patch||this.Update}get dataModel(){return this.AnyQuery?.dataModel}toArray(){return[this.Query,this.QueryInto,this.Create,this.Update,this.Patch,this.Delete].filter(e=>!!e).map(e=>e)}get empty(){return!(this.Query||this.QueryInto||this.Create||this.Update||this.Patch||this.Delete)}add(e){Re.isQueryInto(e)&&!this.QueryInto?this.QueryInto=e:Re.isQuery(e)&&!this.Query?this.Query=e:Re.isCreate(e)&&!this.Create?this.Create=e:Re.isUpdate(e)&&!this.Update?this.Update=e:Re.isPatch(e)&&!this.Patch?this.Patch=e:Re.isDelete(e)&&!this.Delete&&(this.Delete=e)}static from(e){let t=new bt;return e.forEach(e=>{t.add(e)}),t}static forType(t,e){let a=new bt;var l;return N.config.apisResolver&&t&&(l=N.config.apisResolver(t,e))&&(a.Query=l.Query,a.QueryInto=l.QueryInto,a.Create=l.Create,a.Update=l.Update,a.Patch=l.Patch,a.Delete=l.Delete),t&&(e??=N.metadata.value?.api)?.operations.forEach(e=>{e.dataModel?.name==t&&a.add(e)}),a}static createContext(e){let t=e.id||"AutoQueryGrid",a=e.type;var l=_t(e.apis),s=(!a&&e.apis&&0<l.length&&(a=It(l[0])?.dataModel?.name),e.metadataApi??N.metadata.value?.api),r=e.filterDefinitions??(N.metadata.value?.plugins?.autoQuery?.viewerConventions||Mn),n=Ht(a);console.log("createContext",t,a,e.apis,n,l);let o=0<l.length?bt.from(l.map(e=>It(e)).filter(e=>null!=e).map(e=>e)):bt.forType(n,s),i=n||o.AnyQuery?.dataModel?.name,u=i??"",d=Je(i),c=et(d),v=Je(i),p=et(v),f=Jt(v),m=l.map(e=>null==It(e)?e:null).filter(e=>null!=e);return{typeName:n,dataModel:v,dataModelName:i,viewModel:d,viewModelProps:c,dataModelProps:p,dataModelPrimaryKey:f,apis:o,opNames:l,invalidApis:m,metadataApi:s,filterDefinitions:r,prefsCacheKey:()=>t+"/ApiPrefs/"+u,columnCacheKey:e=>`Column/${t}:${u}.`+e}}}let Re={Create:"ICreateDb`1",Update:"IUpdateDb`1",Patch:"IPatchDb`1",Delete:"IDeleteDb`1",AnyRead:["QueryDb`1","QueryDb`2"],AnyWrite:["ICreateDb`1","IUpdateDb`1","IPatchDb`1","IDeleteDb`1"],isAnyQuery:e=>Ee(e.request.inherits,e=>0<=Re.AnyRead.indexOf(e.name)),isQuery:e=>Ee(e.request.inherits,e=>"QueryDb`1"===e.name),isQueryInto:e=>Ee(e.request.inherits,e=>"QueryDb`2"===e.name),isCrud:e=>e.request.implements?.some(e=>0<=Re.AnyWrite.indexOf(e.name)),isCreate:e=>yl(e,Re.Create),isUpdate:e=>yl(e,Re.Update),isPatch:e=>yl(e,Re.Patch),isDelete:e=>yl(e,Re.Delete),model:e=>e?(Ee(e.inherits,e=>0<=Re.AnyRead.indexOf(e.name))?e.inherits:e.implements?.find(e=>0<=Re.AnyWrite.indexOf(e.name)))?.genericArgs[0]:null};function qa(e){return e.input?.type||Pl(ys(e))}function pn(e){return e.endsWith("?")?ba(e,1):e}function Pl(e){return Ea[pn(e)]}function Qa(e){return e&&Na[e]||"String"}function ys(e){return"Nullable`1"===e.type?e.genericArgs[0]:e.type}function ts(e){return e&&"number"==Pl(e)||!1}function yn(e){return e&&"string"==e.toLowerCase()||!1}function Ka(e){return"List`1"==e||e.startsWith("List<")||e.endsWith("[]")}function hn(e){var t;return!(!e?.type||(t=ys(e),e.isValueType&&-1==t.indexOf("`"))||e.isEnum||null!=Pl(e.type))}function bn(e){var t;return!!e?.type&&(t=ys(e),!!(e.isValueType&&-1==t.indexOf("`")||e.isEnum)||!(!(t=e.input?.type)||"hidden"!=t&&"file"!=t&&"tag"!=t&&"combobox"!=t&&!N.components?.[t])||null!=Pl(e.type))}function al(e,t){let a="string"==typeof e?It(e):e,l=(a||(console.warn("Metadata not found for: "+e),a={request:{name:e}}),(()=>function(e){Object.assign(this,e)})()),s=(r.prototype.createResponse=function(){return a.returnsVoid?void 0:new l},r.prototype.getTypeName=function(){return a.request.name},r.prototype.getMethod=function(){return a.method||"POST"},r);function r(e){Object.assign(this,e)}return new s(t)}function _a(e,t,a={}){let l=(()=>function(e){Object.assign(this,e)})(),s=(r.prototype.createResponse=function(){return"function"==typeof a.createResponse?a.createResponse():new l},r.prototype.getTypeName=function(){return e},r.prototype.getMethod=function(){return a.method||"POST"},r);function r(e){Object.assign(this,e)}return new s(t)}function sl(a,e){return a?(Object.keys(a).forEach(e=>{var t=a[e];"string"==typeof t?t.startsWith("/Date")&&(a[e]=jl(gt(t))):null!=t&&"object"==typeof t&&(Array.isArray(t)?a[e]=Array.from(t):a[e]=Object.assign({},t))}),a):{}}function Za(e,n){let o={};return Array.from(e.elements).forEach(e=>{var r=e;if(r.id&&null!=r.value&&""!==r.value){let t=r.id.toLowerCase(),e=n&&n.find(e=>e.name.toLowerCase()==t),a=e?.type,l=e?.genericArgs?.[0],s="checkbox"===r.type?r.checked:r.value;ts(a)?s=Number(s):"List`1"===a&&"string"==typeof s&&(s=s.split(",").map(e=>ts(l)?Number(e):e)),o[r.id]=s}}),o}function hs(e){return e?.api?.operations&&0<e.api.operations.length}function Wa(e){if(bs()||!e?.assert||N.metadata.value)return N.metadata.value;throw new Error("useMetadata() not configured, see: https://docs.servicestack.net/vue/use-metadata")}function ol(e){return!(!e||!hs(e)||(e.date=ha(new Date),N.metadata.value=e,typeof localStorage<"u"&&localStorage.setItem(Wt,JSON.stringify(e)),0))}function Ga(){N.metadata.value=null,typeof localStorage<"u"&&localStorage.removeItem(Wt)}function bs(){if(null!=N.metadata.value)return!0;var e=globalThis.Server;if(hs(e))ol(e);else{e=typeof localStorage<"u"?localStorage.getItem(Wt):null;if(e)try{ol(JSON.parse(e))}catch{console.error(`Could not JSON.parse ${Wt} from localStorage`)}}return null!=N.metadata.value}async function Ws(e,t){var a,l=t?await t():await fetch(e);l.ok?(a=await l.text(),ol(JSON.parse(a))):console.error(`Could not download ${t?"AppMetadata":e}: `+l.statusText),hs(N.metadata.value)||console.warn("AppMetadata is not available")}async function Ja(e){var{olderThan:t,resolvePath:a,resolve:l}=e||{};let s=bs()&&0!==t;if(!(s=s&&t&&(!(r=gt(N.metadata.value?.date))||(new Date).getTime()-r.getTime()>t)?!1:s)){if((a||l)&&(await Ws(a||Wt,l),null!=N.metadata.value))return;var r=Ne("client");if(null!=r&&(t=await r.api(new Ra)).succeeded&&ol(t.response),null!=N.metadata.value)return;await Ws(Wt)}return N.metadata.value}function Je(t,a){if(N.config.typeResolver){var e=N.config.typeResolver(t,a);if(e)return e}var l,e=N.metadata.value?.api;return e&&t?e.types.find(e=>e.name.toLowerCase()===t.toLowerCase()&&(!a||e.namespace==a))||((l=It(t))?l.request:(l=e.operations.find(e=>e.response&&e.response.name.toLowerCase()===t.toLowerCase()&&(!a||e.response.namespace==a)))?l.response:null):null}function It(t){if(N.config.apiResolver){var e=N.config.apiResolver(t);if(e)return e}e=N.metadata.value?.api;return e?e.operations.find(e=>e.request.name.toLowerCase()===t.toLowerCase()):null}function Xa({dataModel:e}){var t=N.metadata.value?.api;if(!t)return[];let a=t.operations;if(e){let t="string"==typeof e?Je(e):e;a=a.filter(e=>wn(e.dataModel,t))}return a}function ws(e){return e?Je(e.name,e.namespace):null}function wn(e,t){return e&&t&&e.name===t.name&&(!e.namespace||!t.namespace||e.namespace===t.namespace)}function Ya(e,t){var a=Je(e);return a&&a.properties&&a.properties.find(e=>e.name.toLowerCase()===t.toLowerCase())}function xn(e){return kn(Je(e))}function kn(t){if(t&&t.isEnum&&null!=t.enumNames){var a={};for(let e=0;e<t.enumNames.length;e++){var l=(t.enumDescriptions?t.enumDescriptions[e]:null)||t.enumNames[e];a[(null!=t.enumValues?t.enumValues[e]:null)||t.enumNames[e]]=l}return a}return null}function Cn(e){if(e){var t={},a=e.input&&e.input.allowableEntries;if(a){for(let e=0;e<a.length;e++){var l=a[e];t[l.key]=l.value}return t}var s=e.allowableValues||(e.input?e.input.allowableValues:null);if(s){for(let e=0;e<s.length;e++){var r=s[e];t[r]=r}return t}if(e.isEnum){var n=Je(e.genericArgs&&1==e.genericArgs.length?e.genericArgs[0]:e.type);if(n)return kn(n)}}return null}function xs(a){if(a){let t=[];return Object.keys(a).forEach(e=>t.push({key:e,value:a[e]})),t}}function eo(e,t){a=e.name,l=t?.type||qa(e)||"text";var a,l,s=Object.assign({id:a,name:a,type:l},t);return e.isEnum&&(s.type="select",s.allowableEntries=xs(Cn(e))),s}function to(t){let r=[];if(t){let l=et(t),e=It(t.name),s=ws(e?.dataModel);l.forEach(t=>{if(bn(t)){let a=eo(t,t.input);var e;if(a.id=ya(a.id),"file"==a.type&&t.uploadTo&&!a.accept&&(e=N.metadata.value?.plugins.filesUpload?.locations.find(e=>e.name==t.uploadTo))&&!a.accept&&e.allowExtensions&&(a.accept=e.allowExtensions.map(e=>e.startsWith(".")?e:"."+e).join(",")),s&&(e=s.properties?.find(e=>e.name==t.name),t.ref||(t.ref=e?.ref)),a.options)try{let e={input:a,$typeFields:l.map(e=>e.name),$dataModelFields:s?et(s).map(e=>e.name):[],...N.config.scopeWhitelist},t=Hl(a.options,e);Object.keys(t).forEach(e=>{a[e]=t[e]})}catch{console.error(`failed to evaluate '${a.options}'`)}r.push(a)}})}return r}function ks(e,t){if(!t.type)return console.error("enumDescriptions missing {type:'EnumType'} options"),[""+e];var a=Je(t.type);if(!a?.enumValues)return console.error("Could not find metadata for "+t.type),[""+e];var l=[];for(let r=0;r<a.enumValues.length;r++){var s=parseInt(a.enumValues[r]);0<s&&(s&e)===s&&l.push(a.enumDescriptions?.[r]||a.enumNames?.[r]||""+e)}return l}function $n(t){return e=>"number"==typeof e?ks(e,{type:t}):e}function et(e){if(!e)return[];let t=[],a={};for(;e;)e.properties&&e.properties.forEach(e=>{a[e.name]||(a[e.name]=1,t.push(e))}),e=e.inherits?ws(e.inherits):null;return t.map(e=>e.type.endsWith("[]")?{...e,type:"List`1",genericArgs:[e.type.substring(0,e.type.length-2)]}:e)}function yl(e,t){return e.request.implements?.some(e=>e.name===t)||!1}function Jt(e){return e?Ln(e,et(e)):null}function Ln(e,t){var a=t.find(e=>"id"===e.name.toLowerCase());if(a&&a.isPrimaryKey)return a;a=t.find(e=>e.isPrimaryKey)||a;if(!a){var l=Re.model(e);if(l)return Ee(Je(l),e=>Jt(e));console.error("Primary Key not found in "+e.name)}return a||null}function lo(e,t){return Ee(Jt(e),e=>ye(t,e.name))}function Vn(e,t,a){return e&&"none"===e.valueType?"":"%In"===a.key||"%Between"===a.key?`(${a.value})`:so(t,a.value)}function so(e,t){return!e||ts(e=pn(e))||"Boolean"===e?t:Ka(e)?`[${t}]`:`'${t}'`}function ht(e,t){return{name:e,value:t}}let Mn=[ht("=","%"),ht("!=","%!"),ht(">=",">%"),ht(">","%>"),ht("<=","%<"),ht("<","<%"),ht("In","%In"),ht("Between","%Between"),{name:"Starts With",value:"%StartsWith",types:"string"},{name:"Contains",value:"%Contains",types:"string"},{name:"Ends With",value:"%EndsWith",types:"string"},{name:"Exists",value:"%IsNotNull",valueType:"none"},{name:"Not Exists",value:"%IsNull",valueType:"none"}];function vt(){var e=c(()=>N.metadata.value?.app||null),t=c(()=>N.metadata.value?.api||null),a=c(()=>N.metadata.value?.plugins?.autoQuery?.viewerConventions||Mn);return bs(),{loadMetadata:Ja,getMetadata:Wa,setMetadata:ol,clearMetadata:Ga,metadataApp:e,metadataApi:t,filterDefinitions:a,typeOf:Je,typeOfRef:ws,typeEquals:wn,apiOf:It,findApis:Xa,typeName:Ua,typeName2:gn,property:Ya,enumOptions:xn,propertyOptions:Cn,createFormLayout:to,typeProperties:et,supportsProp:bn,Crud:Re,Apis:bt,getPrimaryKey:Jt,getPrimaryKeyByProps:Ln,getId:lo,createDto:al,makeDto:_a,toFormValues:sl,formValues:Za,isComplexProp:hn,asKvps:xs,expandEnumFlags:ks,enumFlagsConverter:$n}}class We{static Lookup={};static async getOrFetchValue(e,t,a,l,s,r,n){return We.getValue(a,n,s)??(await We.fetchLookupIds(e,t,a,l,s,r,[n]),We.getValue(a,n,s))}static getValue(e,t,a){var l=We.Lookup[e];if(l){l=l[t];if(l)return l[a=a.toLowerCase()]}}static setValue(e,t,a,l){var s=We.Lookup[e]??(We.Lookup[e]={});(s[t]??(s[t]={}))[a=a.toLowerCase()]=l}static setRefValue(e,t){var a,l=ye(t,e.refId);return null==l||null==e.refLabel?null:(a=ye(t,e.refLabel),We.setValue(e.model,l,e.refLabel,a),a)}static async fetchLookupIds(e,t,s,r,n,o,i){var u=t.operations.find(e=>Re.isAnyQuery(e)&&e.dataModel?.name==s);if(u){let l=We.Lookup[s]??(We.Lookup[s]={}),a=[];Object.keys(l).forEach(e=>{var t=l[e];ye(t,n)&&a.push(e)});var d,c=i.filter(e=>!a.includes(e));0!=c.length&&(d=o?null:r+","+n,c={[r+"In"]:c.join(",")},d&&(c.fields=d),d=al(u,c),(c=await e.api(d,{jsconfig:"edv,eccn"})).succeeded?(ye(c.response,"results")||[]).forEach(e=>{var t,a;ye(e,r)?(t=""+ye(e,r),a=ye(e,n),n=n.toLowerCase(),(l[t]??(l[t]={}))[n]=""+a):console.error(`result[${r}] == null`,e)}):console.error("Failed to call "+u.request.name))}}}let ls=()=>(new Date).getTime(),no=["/","T",":","-"],dt={assumeUtc:!0,date:{method:"Intl.DateTimeFormat",options:"{dateStyle:'medium'}"},maxFieldLength:150,maxNestedFields:2,maxNestedFieldLength:30},ao=new Intl.RelativeTimeFormat(dt.locale,{}),Gs=31536e6,Kl={year:Gs,month:Gs/12,day:864e5,hour:36e5,minute:6e4,second:1e3},Ft={currency:Tn,bytes:Fn,link:An,linkTel:In,linkMailTo:Pn,icon:Dn,iconRounded:Bn,attachment:jn,hidden:On,time:Hn,relativeTime:$s,relativeTimeFromMs:Dl,enumFlags:En,formatDate:Xt,formatNumber:Cs};"iconOnError"in globalThis||(globalThis.iconOnError=Il);class oo{static currency={method:"currency"};static bytes={method:"bytes"};static link={method:"link"};static linkTel={method:"linkTel"};static linkMailTo={method:"linkMailTo"};static icon={method:"icon"};static iconRounded={method:"iconRounded"};static attachment={method:"attachment"};static time={method:"time"};static relativeTime={method:"relativeTime"};static relativeTimeFromMs={method:"relativeTimeFromMs"};static date={method:"formatDate"};static number={method:"formatNumber"};static hidden={method:"hidden"};static enumFlags={method:"enumFlags"}}function io(e){dt=Object.assign({},dt,e)}function ro(t){Object.keys(t||{}).forEach(e=>{"function"==typeof t[e]&&(Ft[e]=t[e])})}function Sn(){return Ft}function cl(e,t){return t?ct("span",e,t):e}function Tn(e,t){var a=ft(t,["currency"]);return cl(new Intl.NumberFormat(void 0,{style:"currency",currency:t?.currency||"USD"}).format(e),a)}function Fn(e,t){return cl(gs(e),t)}function An(e,t){return ct("a",e,Ol({...t,href:e}))}function In(e,t){return ct("a",e,Ol({...t,href:"tel:"+e}))}function Pn(e,t){var{subject:a,body:l}=t=t||{},s=ft(t,["subject","body"]),r={};return a&&(r.subject=a),l&&(r.body=l),ct("a",e,Ol({...s,href:"mailto:"+Zt(e,r)}))}function Dn(e,t){return ct("img",void 0,Object.assign({class:"w-6 h-6",title:e,src:Kt(e),onerror:"iconOnError(this)"},t))}function Bn(e,t){return ct("img",void 0,Object.assign({class:"w-8 h-8 rounded-full",title:e,src:Kt(e),onerror:"iconOnError(this)"},t))}function jn(e,t){var a=fs(e),l=(null==dl(a)||ms(e)?Kt:ps)(e),l=Kt(l),s=t&&(t["icon-class"]||t.iconClass),l=ct("img",void 0,Object.assign({class:"w-6 h-6",src:l,onerror:"iconOnError(this,'att')"},s?{class:s}:null));return ct("a",l+`<span class="pl-1">${a}</span>`,Object.assign({class:"flex",href:Kt(e),title:e},t?ft(t,["icon-class","iconClass"]):null))}function On(e){return""}function Hn(e,t){var a="string"==typeof e?new Date(1e3*nn(e)):Al(e)?gt(e):null;return cl(a?xa(a):e,t)}function Xt(e,t){var a,l;return null==e?"":(a="number"==typeof e?new Date(e):"string"==typeof e?gt(e):e,Al(a)?cl(("function"==typeof(l=dt.date?Bl(dt.date):null)?l:wa)(a),t):(console.warn(a+" is not a Date value"),null==e?"":""+e))}function Cs(e,t){if("number"!=typeof e)return e;let a=dt.number?Bl(dt.number):null,l="function"==typeof a?a(e):""+e;return""===l&&(console.warn(`formatNumber(${e}) => `+l,a),l=""+e),cl(l,t)}function xl(e){var t=Math.floor(e/1e3),a=Math.floor(t/60),l=Math.floor(a/60),s=Math.floor(l/24);return 0<s?s+"d "+xl(e-24*s*60*6e4):0<l?l+"h "+xl(e-60*l*6e4):0<a?a+"m "+xl(e-6e4*a):0<t?t+"s":e+"ms"}function uo(e){return 1e9<=e?(e/1e9).toFixed(1)+"b":1e6<=e?(e/1e6).toFixed(1)+"m":1e3<=e?(e/1e3).toFixed(1)+"k":e.toLocaleString()}function Rn(t,a,l){var e=Ca(t),s=a?Bl(a):null;if("function"!=typeof s)return(null!=e?Al(e)?Xt(e,l):"number"==typeof e?Cs(e,l):e:null)??"";{let e=l;if(a?.options)try{e=Hl(a.options,l)}catch(e){console.error(`Could not evaluate '${a.options}'`,e,", with scope:",l)}return s(t,e)}}function il(e,t,a){return(Bt(e)?Rn:go)(e,t,a)}function co(e){if(null!=e){if("number"==typeof e)return e;if(Al(e))return e.getTime()-ls();if("string"==typeof e){var t=Number(e);if(!isNaN(t))return t;if("P"===e[0]||e.startsWith("-P"))return 1e3*nn(e)*-1;if(0<=ka(e,no))return gt(e).getTime()-ls()}}return NaN}function Dl(e,t){for(var a in Kl)if(Math.abs(e)>Kl[a]||"second"===a)return(t||ao).format(Math.round(e/Kl[a]),a)}function $s(e,t){var a=co(e);return isNaN(a)?"":Dl(a,t)}function fo(e,t){return Dl(e.getTime()-(t?t.getTime():ls()))}function En(e,t){return ks(e,t).join(", ")}function Bl(t){if(t){let{method:e,options:l}=t,s=e+`(${l})`,r=Ft[s]||Ft[e];if("function"==typeof r)return r;let n=t.locale||dt.locale;if(e.startsWith("Intl.")){var a=n?`'${n}'`:"undefined",a=`return new ${e}(${a},${l||"undefined"})`;try{let t=Function(a)();return r="Intl.DateTimeFormat"===e?e=>t.format(gt(e)):"Intl.NumberFormat"===e?e=>t.format(Number(e)):"Intl.RelativeTimeFormat"===e?e=>$s(e,t):e=>t.format(e),Ft[s]=r}catch(e){console.error("Invalid format: "+a,e)}}else{let a=globalThis[e];if("function"==typeof a){let t=null!=l?Function("return "+l)():void 0;return r=e=>a(e,t,n),Ft[s]=r}console.error(`No '${e}' function exists`,Object.keys(Ft))}}return null}function Nn(e,t){return e?e.length>t?e.substring(0,t)+"...":e:""}function zn(e){return"/Date("===e.substring(0,6)?Xt(gt(e)):e}function vo(e){return Ls(Gt(e)).replace(/"/g,"")}function Un(e){if(null==e||""===e)return"";if("string"==typeof e)try{return JSON.parse(e)}catch{console.warn("couldn't parse as JSON",e)}return e}function Ls(e,t=4){return"object"!=typeof(e=Un(e))?"string"==typeof e?e:""+e:JSON.stringify(e,void 0,t)}function mo(e){return"object"!=typeof(e=Un(e))?"string"==typeof e?e:""+e:Ls(e=Gt(e=Object.assign({},e)))}function Gt(a){if(null==a)return null;if("string"==typeof a)return zn(a);if(Bt(a))return a;if(a instanceof Date)return Xt(a);if(Array.isArray(a))return a.map(Gt);if("object"!=typeof a)return a;{let t={};return Object.keys(a).forEach(e=>{"__type"!=e&&(t[e]=Gt(a[e]))}),t}}function go(e,t,a){let l=e;if(Array.isArray(e)){if(Bt(e[0]))return l.join(",");null!=e[0]&&(l=e[0])}if(null==l)return"";if(l instanceof Date)return Xt(l,a);var s=Object.keys(l),r=[];for(let i=0;i<Math.min(dt.maxNestedFields,s.length);i++){var n=s[i],o=""+Gt(l[n]);r.push(`<b class="font-medium">${n}</b>: `+Wl(Nn(zn(o),dt.maxNestedFieldLength)))}return 2<s.length&&r.push("..."),ct("span","{ "+r.join(", ")+" }",Object.assign({title:Wl(vo(e))},a))}function Dm(){return{Formats:oo,setDefaultFormats:io,getFormatters:Sn,setFormatters:ro,formatValue:il,formatter:Bl,dateInputFormat:jl,currency:Tn,bytes:Fn,link:An,linkTel:In,linkMailTo:Pn,icon:Dn,iconRounded:Bn,attachment:jn,hidden:On,time:Hn,relativeTime:$s,relativeTimeFromDate:fo,relativeTimeFromMs:Dl,enumFlags:En,formatDate:Xt,formatNumber:Cs,humanifyMs:xl,humanifyNumber:uo,indentJson:Ls,prettyJson:mo,scrub:Gt,truncate:Nn,apiValueFmt:Rn,iconOnError:Il}}let po=["title"],yo=ue({__name:"RouterLink",props:{to:{}},setup(l){let e=l,t=Ot().config,s=()=>t.value.navigate(e.to??"/");return(e,t)=>(a(),i("a",Ce({onClick:He(s,["prevent"]),title:l.to,href:"javascript:void(0)"},e.$attrs),[O(e.$slots,"default")],16,po))}});class ho{callbacks={};register(e,t){this.callbacks[e]=t}has(e){return!!this.callbacks[e]}invoke(e,t){var a=this.callbacks[e];"function"==typeof a&&a(e,t)}}class bo{get length(){return"u"<typeof localStorage?0:localStorage.length}getItem(e){return"u"<typeof localStorage?null:localStorage.getItem(e)}setItem(e,t){"u"<typeof localStorage||localStorage.setItem(e,t)}removeItem(e){"u"<typeof localStorage||localStorage.removeItem(e)}clear(){"u"<typeof localStorage||localStorage.clear()}key(e){return"u"<typeof localStorage?null:localStorage.key(e)}}class N{static config={redirectSignIn:"/signin",redirectSignOut:"/auth/logout",navigate:e=>location.href=e,assetsPathResolver:e=>e,fallbackPathResolver:e=>e,storage:new bo,tableIcon:{svg:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><g fill='none' stroke='currentColor' stroke-width='1.5'><path d='M5 12v6s0 3 7 3s7-3 7-3v-6'/><path d='M5 6v6s0 3 7 3s7-3 7-3V6'/><path d='M12 3c7 0 7 3 7 3s0 3-7 3s-7-3-7-3s0-3 7-3Z'/></g></svg>"},scopeWhitelist:{enumFlagsConverter:$n,...Sn()}};static autoQueryGridDefaults={deny:[],hide:[],toolbarButtonClass:void 0,tableStyle:"stripedRows",take:25,maxFieldLength:150};static events=$a();static user=A(null);static metadata=Zl(null);static components={RouterLink:yo};static component(e){var t=N.components[e];if(t)return t;let a=Qs(e),l=Object.keys(N.components).find(e=>Qs(e)===a);return l&&N.components[l]||null}static interceptors=new ho}function wo(e){N.config=Object.assign(N.config,e)}function xo(e){N.autoQueryGridDefaults=Object.assign(N.autoQueryGridDefaults,e)}function Vs(e){return e&&N.config.assetsPathResolver?N.config.assetsPathResolver(e):e}function ko(e){return e&&N.config.fallbackPathResolver?N.config.fallbackPathResolver(e):e}function Co(e,t){N.interceptors.register(e,t)}function Ot(){var e=c(()=>N.config),t=c(()=>N.autoQueryGridDefaults),a=N.events;return{Sole:N,config:e,setConfig:wo,events:a,autoQueryGridDefaults:t,setAutoQueryGridDefaults:xo,assetsPathResolver:Vs,fallbackPathResolver:ko,registerInterceptor:Co}}function jl(e){var t;return null==e||"object"==typeof e||null==(t=gt(e))||"Invalid Date"==t.toString()?"":t.toISOString().substring(0,10)??""}function qn(e){var t;return null==e||"object"==typeof e||null==(t=gt(e))||"Invalid Date"==t.toString()?"":t.toISOString().substring(0,19)??""}function Qn(e){return null==e?"":Ma(e)}function ss(e,t){return N.config.inputValue?N.config.inputValue(e,t):"date"===e?jl(t):"datetime-local"===e?qn(t):"time"===e?Qn(t):"number"===e||"range"===e?null==t?"":Number(t):t}function Kn(e,t){e.value=null,wt(()=>e.value=t)}function qt(a){return Object.keys(a).forEach(e=>{var t=a[e];a[e]=en(t)?G(t):t}),a}function xt(e,t,a){a?(t.value=e.entering.cls+" "+e.entering.from,setTimeout(()=>t.value=e.entering.cls+" "+e.entering.to,0)):(t.value=e.leaving.cls+" "+e.leaving.from,setTimeout(()=>t.value=e.leaving.cls+" "+e.leaving.to,0))}function kl(a){if(!("u"<typeof document)){let t=a?.after||document.activeElement,e=t&&t.form;var l,s;e&&(l=':not([disabled]):not([tabindex="-1"])',l=e.querySelectorAll(`a:not([disabled]), button${l}, input[type=text]${l}, [tabindex]`+l),-1<(s=(l=Array.prototype.filter.call(l,e=>0<e.offsetWidth||0<e.offsetHeight||e===t)).indexOf(t)))&&(l[s+1]||l[0]).focus()}}function Ht(e){if(!e)return null;if("string"==typeof e)return e;var t="function"==typeof e?new e:"object"==typeof e?e:null;if(!t)throw new Error(`Invalid DTO Type '${typeof e}'`);if("function"!=typeof t.getTypeName)throw new Error(JSON.stringify(t)+" is not a Request DTO");t=t.getTypeName();if(t)return t;throw new Error("DTO Required")}function ct(e,t,a){var l=(a=a||{}).cls||a.className||a.class;return l&&((a=ft(a,["cls","class","className"])).class=l),null==t?"<"+e+ns(a)+"/>":"<"+e+ns(a)+`>${t||""}</${e}>`}function ns(a){return Object.keys(a).reduce((e,t)=>`${e} ${t}="${Wl(a[t])}"`,"")}function Ol(e){return Object.assign({target:"_blank",rel:"noopener",class:"text-blue-600"},e)}function Kt(e){return Vs(e)}let $o=["string","number","boolean","null","undefined"];function Bt(e){return 0<=$o.indexOf(typeof e)||e instanceof Date}function rl(e){return!Bt(e)}function Vl(e){return"string"==typeof e?JSON.parse(e):null}function Ms(e,t){var a;typeof history<"u"&&(a=t?Zt(an(location.href,"?"),e):Va(location.href,e),history.pushState({},"",a))}function Hl(t,e){if(["function","Function","eval","=>",";"].some(e=>t.includes(e)))throw new Error(`Unsafe script: '${t}'`);var a=Object.assign(Object.keys(globalThis).reduce((e,t)=>(e[t]=void 0,e),{}),e);return new Function("with(this) { return ("+t+") }").call(a)}function as(e){typeof navigator<"u"&&navigator.clipboard.writeText(e)}function Ss(e){var t=N.config.storage.getItem(e);return t?JSON.parse(t):null}function Rl(e,t){return Zt("swr."+La(e),t?Object.assign({},e,t):e)}function Lo(e){var t;e.request&&(t=Rl(e.request,e.args),N.config.storage.removeItem(t))}async function _n(e,t,a,l,s){var r,n=Rl(t,l),o=(a(new Ge({response:Ss(n)})),await e.api(t,l,s));return o.succeeded&&o.response&&(o.response._date=(new Date).valueOf(),r=JSON.stringify(o.response),N.config.storage.setItem(n,r),a(o)),o}function Zn(t,a){let l=null;return(...e)=>{l&&clearTimeout(l),l=setTimeout(()=>{t(...e)},a||100)}}function _t(e){return"string"==typeof e?e.split(","):e||[]}function At(e,t){let a=_t(t);return e.reduce((e,t)=>(e[t]=!a.includes(t),e),{})}function Vo(t){return new Promise(e=>setTimeout(e,t))}function Wn(e){var t,a=[],l=[];for(t of e){var s=t.toLowerCase();l.includes(s)||(a.push(t),l.push(s))}return a}function Gn(){return{dateInputFormat:jl,dateTimeInputFormat:qn,timeInputFormat:Qn,textInputValue:ss,setRef:Kn,unRefs:qt,transition:xt,focusNextElement:kl,getTypeName:Ht,htmlTag:ct,htmlAttrs:ns,linkAttrs:Ol,toAppUrl:Kt,isPrimitive:Bt,isComplexType:rl,pushState:Ms,scopedExpr:Hl,copyText:as,fromCache:Ss,swrCacheKey:Rl,swrClear:Lo,swrApi:_n,asStrings:_t,asOptions:At,createDebounce:Zn,delay:Vo,uniqueIgnoreCase:Wn}}function fl(e){let r=A(!1),n=A(),o=A(),i=e??Ne("client");function s({message:e,errorCode:t,fieldName:a,errors:l}){return t=t||"Exception",l=l||[],n.value=new Ql(a?{errorCode:t,message:e,errors:[new Ks({fieldName:a,errorCode:t,message:e})]}:{errorCode:t,message:e,errors:l})}var t={setError:s,addFieldError:function({fieldName:t,message:e,errorCode:a}){var l;a=a||"Exception",n.value?((l=new Ql(n.value)).errors=[...(l.errors||[]).filter(e=>e.fieldName?.toLowerCase()!==t?.toLowerCase()),new Ks({fieldName:t,message:e,errorCode:a})],n.value=l):s({fieldName:t,message:e,errorCode:a})},loading:r,error:n,api:async function(e,t,a){r.value=!0;var l=await i.api(qt(e),t,a);return r.value=!1,o.value=l.response,n.value=l.error,l},apiVoid:async function(e,t,a){r.value=!0;var l=await i.apiVoid(qt(e),t,a);return r.value=!1,o.value=l.response,n.value=l.error,l},apiForm:async function(e,t,a,l){r.value=!0;var s=await i.apiForm(qt(e),t,a,l);return r.value=!1,o.value=s.response,n.value=s.error,s},apiFormVoid:async function(e,t,a,l){r.value=!0;var s=await i.apiFormVoid(qt(e),t,a,l);return r.value=!1,o.value=s.response,n.value=s.error,s},swr:async function(e,t,a,l){return _n(i,e,t,a,l)},swrEffect:function(a,l){let s=A(new Ge),r=Zn(async e=>{s.value=await i.api(e)},l?.delayMs);return Cl(async()=>{var e=a(),t=Ss(Rl(e));t&&(s.value=new Ge({response:t})),0===l?.delayMs?s.value=await i.api(e):r(e)}),(async()=>s.value=await i.api(a(),l?.args,l?.method))(),s},unRefs:qt,setRef:Kn};return ul("ApiState",t),t}function Jn(e){return e&&e.SessionId?Sa(e):e}function Mo(e){N.user.value=Jn(e),N.events.publish("signIn",e)}function So(){N.user.value=null,N.events.publish("signOut",null)}let Ts=e=>e?.roles||[],Fs=e=>e?.permissions||[];function Xn(e){return 0<=Ts(N.user.value).indexOf(e)}function To(e){return 0<=Fs(N.user.value).indexOf(e)}function As(){return Xn("Admin")}function nl(e){if(!e)return!1;if(!e.requiresAuth)return!0;var t=N.user.value;if(!t)return!1;if(As())return!0;let[a,l]=[Ts(t),Fs(t)],[s,r,n,o]=[e.requiredRoles||[],e.requiredPermissions||[],e.requiresAnyRole||[],e.requiresAnyPermission||[]];return!(!s.every(e=>0<=a.indexOf(e))||0<n.length&&!n.some(e=>0<=a.indexOf(e))||!r.every(e=>0<=l.indexOf(e))||0<o.length&&!o.every(e=>0<=l.indexOf(e)))}function Fo(e){if(!e||!e.requiresAuth)return null;var t=N.user.value;if(!t)return`<b>${e.request.name}</b> requires Authentication`;if(As())return null;let[a,l]=[Ts(t),Fs(t)],[s,r,n,o]=[e.requiredRoles||[],e.requiredPermissions||[],e.requiresAnyRole||[],e.requiresAnyPermission||[]],i=s.filter(e=>a.indexOf(e)<0);return 0<i.length?`Requires ${i.map(e=>"<b>"+e+"</b>").join(", ")} Role`+(1<i.length?"s":""):0<(t=r.filter(e=>l.indexOf(e)<0)).length?`Requires ${t.map(e=>"<b>"+e+"</b>").join(", ")} Permission`+(1<t.length?"s":""):0<n.length&&!n.some(e=>0<=a.indexOf(e))?`Requires any ${n.filter(e=>a.indexOf(e)<0).map(e=>"<b>"+e+"</b>").join(", ")} Role`+(1<i.length?"s":""):0<o.length&&!o.every(e=>0<=l.indexOf(e))?`Requires any ${o.filter(e=>l.indexOf(e)<0).map(e=>"<b>"+e+"</b>").join(", ")} Permission`+(1<t.length?"s":""):null}function Is(){return{signIn:Mo,signOut:So,user:c(()=>N.user.value||null),toAuth:Jn,isAuthenticated:c(()=>null!=N.user.value),hasRole:Xn,hasPermission:To,isAdmin:As,canAccess:nl,invalidAccessMessage:Fo}}function Ze(e,t){return Array.isArray(e)?0<=e.indexOf(t):e==t||e.includes(t)}let Ml={blue:"text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-200",purple:"text-purple-600 dark:text-purple-400 hover:text-purple-800 dark:hover:text-purple-200",red:"text-red-700 dark:text-red-400 hover:text-red-900 dark:hover:text-red-200",green:"text-green-600 dark:text-green-400 hover:text-green-800 dark:hover:text-green-200",sky:"text-sky-600 dark:text-sky-400 hover:text-sky-800 dark:hover:text-sky-200",cyan:"text-cyan-600 dark:text-cyan-400 hover:text-cyan-800 dark:hover:text-cyan-200",indigo:"text-indigo-600 dark:text-indigo-400 hover:text-indigo-800 dark:hover:text-indigo-200"},rt={base:"block w-full sm:text-sm rounded-md dark:text-white dark:bg-gray-900 disabled:bg-slate-50 dark:disabled:bg-slate-900 disabled:text-slate-500 disabled:border-slate-200 dark:disabled:border-slate-700 disabled:shadow-none",invalid:"pr-10 border-red-300 text-red-900 placeholder-red-300 focus:outline-none focus:ring-red-500 focus:border-red-500",valid:"shadow-sm focus:ring-indigo-500 focus:border-indigo-500 border-gray-300 dark:border-gray-600"},tl={panelClass:"shadow sm:rounded-md",formClass:"space-y-6 bg-white dark:bg-black py-6 px-4 sm:p-6",headingClass:"text-lg font-medium leading-6 text-gray-900 dark:text-gray-100",subHeadingClass:"mt-1 text-sm text-gray-500 dark:text-gray-400"},Qt={panelClass:"pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",formClass:"flex h-full flex-col divide-y divide-gray-200 dark:divide-gray-700 shadow-xl bg-white dark:bg-black",titlebarClass:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6",headingClass:"text-lg font-medium text-gray-900 dark:text-gray-100",subHeadingClass:"mt-1 text-sm text-gray-500 dark:text-gray-400",closeButtonClass:"rounded-md bg-gray-50 dark:bg-gray-900 text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:ring-offset-black"},os={modalClass:"relative transform overflow-hidden rounded-lg bg-white dark:bg-black text-left shadow-xl transition-all sm:my-8",sizeClass:"sm:max-w-prose lg:max-w-screen-md xl:max-w-screen-lg 2xl:max-w-screen-xl sm:w-full"},Oe={panelClass(e="slideOver"){return("card"==e?tl:Qt).panelClass},formClass(e="slideOver"){return("card"==e?tl:Qt).formClass},headingClass(e="slideOver"){return("card"==e?tl:Qt).headingClass},subHeadingClass(e="slideOver"){return("card"==e?tl:Qt).subHeadingClass},buttonsClass:"px-4 py-3 bg-gray-50 dark:bg-gray-900 sm:px-6 flex flex-wrap justify-between",legendClass:"text-base font-medium text-gray-900 dark:text-gray-100 text-center mb-4"},ge={getGridClass(e=0){return ge.gridClass},getGrid2Class(e="stripedRows"){return Ze(e,"fullWidth")?"overflow-x-auto":ge.grid2Class},getGrid3Class(e="stripedRows"){return Ze(e,"fullWidth")?"inline-block min-w-full py-2 align-middle":ge.grid3Class},getGrid4Class(e="stripedRows"){return Ze(e,"whiteBackground")?"":Ze(e,"fullWidth")?"overflow-hidden shadow-sm ring-1 ring-black/5":ge.grid4Class},getTableClass(e="stripedRows"){return Ze(e,"fullWidth")||Ze(e,"verticalLines")?"min-w-full divide-y divide-gray-300":ge.tableClass},getTheadClass(e="stripedRows"){return Ze(e,"whiteBackground")?"":ge.theadClass},getTheadRowClass(e="stripedRows"){return ge.theadRowClass+(Ze(e,"verticalLines")?" divide-x divide-gray-200 dark:divide-gray-700":"")},getTheadCellClass(e="stripedRows"){return ge.theadCellClass+(Ze(e,"uppercaseHeadings")?" uppercase":"")},getTbodyClass(e="stripedRows"){return(Ze(e,"whiteBackground")||Ze(e,"verticalLines")?"divide-y divide-gray-200 dark:divide-gray-800":ge.tableClass)+(Ze(e,"verticalLines")?" bg-white":"")},getTableRowClass(e="stripedRows",t,a,l){return(l?"cursor-pointer ":"")+(a?"bg-indigo-100 dark:bg-blue-800":(l?"hover:bg-yellow-50 dark:hover:bg-blue-900 ":"")+(!Ze(e,"stripedRows")||t%2==0?"bg-white dark:bg-black":"bg-gray-50 dark:bg-gray-800"))+(Ze(e,"verticalLines")?" divide-x divide-gray-200 dark:divide-gray-700":"")},gridClass:"flex flex-col",grid2Class:"",grid3Class:"inline-block min-w-full py-2 align-middle",grid4Class:"overflow-hidden shadow ring-1 ring-black/5 md:rounded-lg",tableClass:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",theadClass:"bg-gray-50 dark:bg-gray-900",tableCellClass:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400",theadRowClass:"select-none",theadCellClass:"px-6 py-4 text-left text-sm font-medium tracking-wider whitespace-nowrap",toolbarButtonClass:"inline-flex items-center px-2.5 py-1.5 border border-gray-300 dark:border-gray-700 shadow-sm text-sm font-medium rounded text-gray-700 dark:text-gray-300 bg-white dark:bg-black hover:bg-gray-50 dark:hover:bg-gray-900 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black"},Ao={colspans:"col-span-3 sm:col-span-3"};function Ct(e,t,a){var l=e.filter(e=>e).join(" ");return(a??=null==N.config.filterInputClass?void 0:e=>N.config.filterInputClass(e,t))?a(l):l}let Bm=Object.freeze(Object.defineProperty({__proto__:null,a:Ml,card:tl,dummy:Ao,filterClass:Ct,form:Oe,grid:ge,input:rt,modal:os,slideOver:Qt},Symbol.toStringTag,{value:"Module"})),Io={class:"flex items-center"},Po={key:0,class:"flex-shrink-0 mr-3"},Do={key:0,class:"h-5 w-5 text-yellow-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Bo={key:1,class:"h-5 w-5 text-red-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},jo={key:2,class:"h-5 w-5 text-blue-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Oo={key:3,class:"h-5 w-5 text-green-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Ho=ue({__name:"Alert",props:{type:{default:"warn"},hideIcon:{type:Boolean}},setup(l){let e=l,r=c(()=>"info"==e.type?"bg-blue-50 dark:bg-blue-200":"error"==e.type?"bg-red-50 dark:bg-red-200":"success"==e.type?"bg-green-50 dark:bg-green-200":"bg-yellow-50 dark:bg-yellow-200"),n=c(()=>"info"==e.type?"border-blue-400":"error"==e.type?"border-red-400":"success"==e.type?"border-green-400":"border-yellow-400"),o=c(()=>"info"==e.type?"text-blue-700":"error"==e.type?"text-red-700":"success"==e.type?"text-green-700":"text-yellow-700");return(e,t)=>(a(),i("div",{class:g([r.value,n.value,"border-l-4 p-4"])},[s("div",Io,[l.hideIcon?x("",!0):(a(),i("div",Po,["warn"==l.type?(a(),i("svg",Do,[...t[0]||(t[0]=[s("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"},null,-1)])])):"error"==l.type?(a(),i("svg",Bo,[...t[1]||(t[1]=[s("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z","clip-rule":"evenodd"},null,-1)])])):"info"==l.type?(a(),i("svg",jo,[...t[2]||(t[2]=[s("path",{"fill-rule":"evenodd",d:"M19 10.5a8.5 8.5 0 11-17 0 8.5 8.5 0 0117 0zM8.25 9.75A.75.75 0 019 9h.253a1.75 1.75 0 011.709 2.13l-.46 2.066a.25.25 0 00.245.304H11a.75.75 0 010 1.5h-.253a1.75 1.75 0 01-1.709-2.13l.46-2.066a.25.25 0 00-.245-.304H9a.75.75 0 01-.75-.75zM10 7a1 1 0 100-2 1 1 0 000 2z","clip-rule":"evenodd"},null,-1)])])):"success"==l.type?(a(),i("svg",Oo,[...t[3]||(t[3]=[s("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z","clip-rule":"evenodd"},null,-1)])])):x("",!0)])),s("div",null,[s("p",{class:g([o.value,"text-sm"])},[O(e.$slots,"default")],2)])])],2))}}),Ro={key:0,class:"rounded-md bg-green-50 dark:bg-green-200 p-4",role:"alert"},Eo={class:"flex"},No={class:"ml-3"},zo={class:"text-sm font-medium text-green-800"},Uo={key:0},qo={class:"ml-auto pl-3"},Qo={class:"-mx-1.5 -my-1.5"},Ko=ue({__name:"AlertSuccess",props:{message:{}},setup(l){let r=A(!1);return(e,t)=>r.value?x("",!0):(a(),i("div",Ro,[s("div",Eo,[t[2]||(t[2]=s("div",{class:"flex-shrink-0"},[s("svg",{class:"h-5 w-5 text-green-400 dark:text-green-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})])],-1)),s("div",No,[s("h3",zo,[l.message?(a(),i("span",Uo,T(l.message),1)):O(e.$slots,"default",{key:1})])]),s("div",qo,[s("div",Qo,[s("button",{type:"button",class:"inline-flex rounded-md bg-green-50 dark:bg-green-200 p-1.5 text-green-500 dark:text-green-600 hover:bg-green-100 dark:hover:bg-green-800 dark:hover:text-white focus:outline-none focus:ring-2 focus:ring-green-600 dark:focus:ring-green-300 focus:ring-offset-2 focus:ring-offset-green-50 dark:ring-offset-green-900",onClick:t[0]||(t[0]=e=>r.value=!0)},[...t[1]||(t[1]=[s("span",{class:"sr-only"},"Dismiss",-1),s("svg",{class:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})],-1)])])])])])]))}}),_o={class:"flex"},Zo={class:"ml-3"},Wo={class:"text-sm text-red-700 dark:text-red-200"},Go=ue({__name:"ErrorSummary",props:{status:{},except:{},class:{}},setup(e){let t=e,l=Ne("ApiState",void 0),r=c(()=>t.status||l?.error.value?Ta.call({responseStatus:t.status??l?.error.value},t.except??[]):null);return(e,t)=>r.value?(a(),i("div",{key:0,class:g("bg-red-50 dark:bg-red-900 border-l-4 border-red-400 p-4 "+e.$props.class)},[s("div",_o,[t[0]||(t[0]=s("div",{class:"flex-shrink-0"},[s("svg",{class:"h-5 w-5 text-red-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{fill:"currentColor",d:"M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12S6.47 2 12 2m3.59 5L12 10.59L8.41 7L7 8.41L10.59 12L7 15.59L8.41 17L12 13.41L15.59 17L17 15.59L13.41 12L17 8.41L15.59 7Z"})])],-1)),s("div",Zo,[s("p",Wo,T(r.value),1)])])],2)):x("",!0)}}),Jo=["id","aria-describedby"],Xo=ue({__name:"InputDescription",props:{id:{},description:{}},setup(l){return(e,t)=>l.description?(a(),i("div",{key:"description",class:"mt-2 text-sm text-gray-500",id:l.id+"-description","aria-describedby":l.id+"-description"},[s("div",null,T(l.description),1)],8,Jo)):x("",!0)}}),Yn=ue({inheritAttrs:!1,props:{image:Object,svg:String,src:String,alt:String,type:String},setup(s,{attrs:r}){return()=>{let e=s.image;var t,a;s.type&&(a=vt().typeOf,(a=a(s.type))||console.warn(`Type ${s.type} does not exist`),a?.icon?e=a?.icon:console.warn(`Type ${s.type} does not have a [Svg] icon`));let l=s.svg||e?.svg||"";return l.startsWith("<svg ")?(a=Fl(l,">").indexOf("class="),t=`${e?.cls||""} `+(r.class||""),l=-1==a?`<svg class="${t}" `+l.substring(4):(a=a+6+1,l.substring(0,a)+t+" "+l.substring(a)),St("span",{innerHTML:l})):St("img",{class:[e?.cls,r.class],src:Vs(s.src||e?.uri),onError:e=>Il(e.target)})}}}),Yo={class:"text-2xl font-semibold text-gray-900 dark:text-gray-300"},ei={class:"flex"},ti=ue({__name:"Loading",props:{imageClass:{default:"w-6 h-6"}},setup(l){return(e,t)=>(a(),i("div",Yo,[s("div",ei,[(a(),i("svg",{class:g(["self-center inline mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-gray-600 dark:fill-gray-300",l.imageClass]),role:"status",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...t[0]||(t[0]=[s("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"},null,-1),s("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"},null,-1)])],2)),s("span",null,[O(e.$slots,"default")])])]))}}),li=["href","onClick"],si=["type"],Js="inline-flex items-center px-4 py-2 border border-gray-300 dark:border-gray-600 shadow-sm text-sm font-medium rounded-md text-gray-700 dark:text-gray-200 disabled:text-gray-400 bg-white dark:bg-black hover:bg-gray-50 hover:dark:bg-gray-900 disabled:hover:bg-white dark:disabled:hover:bg-black focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black",ni=ue({__name:"OutlineButton",props:{type:{default:"submit"},href:{}},setup(r){return(t,e)=>{var l=U("router-link");return r.href?(a(),X(l,{key:0,to:r.href},{default:we(({navigate:e})=>[s("button",{class:g(Js),href:r.href,onClick:e},[O(t.$slots,"default")],8,li)]),_:3},8,["to"])):(a(),i("button",Ce({key:1,type:r.type,class:Js},t.$attrs),[O(t.$slots,"default")],16,si))}}}),ai=["href","onClick"],oi=["type"],ii=ue({__name:"PrimaryButton",props:{type:{default:"submit"},href:{},color:{default:"indigo"}},setup(r){let e=r,t={blue:"focus:ring-blue-500 bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 disabled:hover:bg-blue-400 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",purple:"focus:ring-purple-500 bg-purple-600 hover:bg-purple-700 disabled:bg-purple-400 disabled:hover:bg-purple-400 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-800",red:"focus:ring-red-500 bg-red-600 hover:bg-red-700 disabled:bg-red-400 disabled:hover:bg-red-400 focus:ring-red-500 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-500",green:"focus:ring-green-500 bg-green-600 hover:bg-green-700 disabled:bg-green-400 disabled:hover:bg-green-400 focus:ring-green-500 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-500",sky:"focus:ring-sky-500 bg-sky-600 hover:bg-sky-700 disabled:bg-sky-400 disabled:hover:bg-sky-400 dark:bg-sky-600 dark:hover:bg-sky-700 dark:focus:ring-sky-500",cyan:"focus:ring-cyan-500 bg-cyan-600 hover:bg-cyan-700 disabled:bg-cyan-400 disabled:hover:bg-cyan-400 dark:bg-cyan-600 dark:hover:bg-cyan-700 dark:focus:ring-cyan-500",indigo:"focus:ring-indigo-500 bg-indigo-600 hover:bg-indigo-700 disabled:bg-indigo-400 disabled:hover:bg-indigo-400 dark:bg-indigo-600 dark:hover:bg-indigo-700 dark:focus:ring-indigo-800"},n=c(()=>"inline-flex justify-center rounded-md border border-transparent py-2 px-4 text-sm font-medium shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 dark:ring-offset-black text-white "+(t[e.color]||t.indigo));return(t,e)=>{var l=U("router-link");return r.href?(a(),X(l,{key:0,to:r.href},{default:we(({navigate:e})=>[s("button",{class:g(n.value),href:r.href,onClick:e},[O(t.$slots,"default")],10,ai)]),_:3},8,["to"])):(a(),i("button",Ce({key:1,type:r.type,class:n.value},t.$attrs),[O(t.$slots,"default")],16,oi))}}}),ri=["type","href","onClick"],ui=["type"],Xs="inline-flex justify-center rounded-md border border-gray-300 py-2 px-4 text-sm font-medium shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 bg-white dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-400 dark:hover:text-white hover:bg-gray-50 dark:hover:bg-gray-700 focus:ring-indigo-500 dark:focus:ring-indigo-600 dark:ring-offset-black",di=ue({__name:"SecondaryButton",props:{type:{},href:{}},setup(r){return(t,e)=>{var l=U("router-link");return r.href?(a(),X(l,{key:0,to:r.href},{default:we(({navigate:e})=>[s("button",{type:r.type??"button",class:g(Xs),href:r.href,onClick:e},[O(t.$slots,"default")],8,ri)]),_:3},8,["to"])):(a(),i("button",Ce({key:1,type:r.type??"button",class:Xs},t.$attrs),[O(t.$slots,"default")],16,ui))}}}),ci=ue({__name:"TextLink",props:{color:{default:"blue"}},setup(e){let t=ca(),l=e,s=c(()=>(Ml[l.color]||Ml.blue)+(t.href?"":" cursor-pointer"));return(e,t)=>(a(),i("a",{class:g(s.value)},[O(e.$slots,"default")],2))}}),fi={class:"flex","aria-label":"Breadcrumb"},vi={role:"list",class:"flex items-center space-x-4"},mi=["href","title"],gi={class:"sr-only"},pi=ue({__name:"Breadcrumbs",props:{homeHref:{default:"/"},homeLabel:{default:"Home"}},setup(l){return(e,t)=>(a(),i("nav",fi,[s("ol",vi,[s("li",null,[s("div",null,[s("a",{href:l.homeHref,class:"text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400",title:l.homeLabel},[t[0]||(t[0]=s("svg",{class:"h-6 w-6 flex-shrink-0",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M9.293 2.293a1 1 0 011.414 0l7 7A1 1 0 0117 11h-1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-3a1 1 0 00-1-1H9a1 1 0 00-1 1v3a1 1 0 01-1 1H5a1 1 0 01-1-1v-6H3a1 1 0 01-.707-1.707l7-7z","clip-rule":"evenodd"})],-1)),s("span",gi,T(l.homeLabel),1)],8,mi)])]),O(e.$slots,"default")])]))}}),yi={class:"flex items-center"},hi=["href","title"],bi=["title"],wi=ue({__name:"Breadcrumb",props:{href:{},title:{}},setup(l){return(e,t)=>(a(),i("li",null,[s("div",yi,[t[0]||(t[0]=s("svg",{class:"h-6 w-6 flex-shrink-0 text-gray-400 dark:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z","clip-rule":"evenodd"})],-1)),l.href?(a(),i("a",{key:0,href:l.href,class:"ml-4 text-lg font-medium text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300",title:l.title},[O(e.$slots,"default")],8,hi)):(a(),i("span",{key:1,class:"ml-4 text-lg font-medium text-gray-700 dark:text-gray-300",title:l.title},[O(e.$slots,"default")],8,bi))])]))}}),xi={key:0,class:"text-base font-semibold text-gray-500 dark:text-gray-400"},ki={role:"list",class:"mt-4 divide-y divide-gray-200 dark:divide-gray-800 border-t border-b border-gray-200 dark:border-gray-800"},Ci=ue({__name:"NavList",props:{title:{}},setup(l){return(e,t)=>(a(),i("div",null,[l.title?(a(),i("h2",xi,T(l.title),1)):x("",!0),s("ul",ki,[O(e.$slots,"default")])]))}}),$i={class:"relative flex items-start space-x-4 py-6"},Li={class:"flex-shrink-0"},Vi={class:"flex h-12 w-12 items-center justify-center rounded-lg bg-indigo-50 dark:bg-indigo-900"},Mi={class:"min-w-0 flex-1"},Si={class:"text-base font-medium text-gray-900 dark:text-gray-100"},Ti={class:"rounded-sm focus-within:ring-2 focus-within:ring-indigo-500 focus-within:ring-offset-2"},Fi=["href"],Ai={class:"text-base text-gray-500"},Ii=ue({__name:"NavListItem",props:{title:{},href:{},icon:{},iconSvg:{},iconSrc:{},iconAlt:{}},setup(r){return(e,t)=>{var l=U("Icon");return a(),i("li",$i,[s("div",Li,[s("span",Vi,[pe(l,{class:"w-6 h-6 text-indigo-700 dark:text-indigo-300",image:r.icon,src:r.iconSrc,svg:r.iconSvg,alt:r.iconAlt},null,8,["image","src","svg","alt"])])]),s("div",Mi,[s("h3",Si,[s("span",Ti,[s("a",{href:r.href,class:"focus:outline-none"},[t[0]||(t[0]=s("span",{class:"absolute inset-0","aria-hidden":"true"},null,-1)),he(" "+T(r.title),1)],8,Fi)])]),s("p",Ai,[O(e.$slots,"default")])]),t[1]||(t[1]=s("div",{class:"flex-shrink-0 self-center"},[s("svg",{class:"h-5 w-5 text-gray-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z","clip-rule":"evenodd"})])],-1))])}}}),Pi={key:0},Di={class:"md:p-4"},ea=ue({__name:"EnsureAccess",props:{invalidAccess:{},alertClass:{}},emits:["done"],setup(n){let o=Is().isAuthenticated,t=Ot().config,u=()=>{var e=location.href.substring(location.origin.length)||"/",e=Zt(t.value.redirectSignIn,{redirect:e});t.value.navigate(e)},d=()=>{var e=location.href.substring(location.origin.length)||"/",e=Zt(t.value.redirectSignOut,{ReturnUrl:e});t.value.navigate(e)};return(e,t)=>{var l=U("Alert"),r=U("SecondaryButton");return n.invalidAccess?(a(),i("div",Pi,[pe(l,{class:g(n.alertClass),innerHTML:n.invalidAccess},null,8,["class","innerHTML"]),s("div",Di,[G(o)?(a(),X(r,{key:1,onClick:d},{default:we(()=>[...t[1]||(t[1]=[he("Sign Out",-1)])]),_:1})):(a(),X(r,{key:0,onClick:u},{default:we(()=>[...t[0]||(t[0]=[he("Sign In",-1)])]),_:1}))])])):x("",!0)}}}),Bi={class:"absolute top-0 right-0 bg-white dark:bg-black border dark:border-gray-800 rounded normal-case text-sm shadow w-80"},ji={class:"p-4"},Oi={class:"flex w-full justify-center"},Hi={key:0},Ri=["id","value"],Ei=["for"],Ni={key:1},zi={class:"mb-2"},Ui={class:"inline-flex rounded-full items-center py-0.5 pl-2.5 pr-1 text-sm font-medium bg-indigo-100 text-indigo-700"},qi=["onClick"],Qi={class:"flex"},Ki={class:"bg-gray-50 dark:bg-gray-900 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},Ps=ue({__name:"FilterColumn",props:{definitions:{},column:{},topLeft:{}},emits:["done","save"],setup(u,{emit:e}){let d=u,t=e,v=A(),p=A(""),f=A(""),m=A([]),y=c(()=>1==d.column.meta.isEnum),l=c(()=>Je("Nullable`1"===d.column.meta.type?d.column.meta.genericArgs[0]:d.column.meta.type)),h=c(()=>1==d.column.meta.isEnum?xs(xn(l.value.name)):[]),b=c(()=>r(d.column.type)?.map(e=>({key:e.value,value:e.name}))||[]),w=A({filters:[]}),k=c(()=>w.value.filters);function r(e){let t=d.definitions;return t=yn(e)?t:t.filter(e=>"string"!==e.types)}function C(e,t){return r(e).find(e=>e.value===t)}function L(){var e;p.value&&(e=C(d.column.type,p.value)?.name)&&(w.value.filters.push({key:p.value,name:e,value:f.value}),p.value=f.value="")}function V(){t("done")}function S(){p.value="%",v.value?.focus()}function M(){var e;f.value&&L(),y.value&&(e=Object.values(m.value).filter(e=>e),w.value.filters=0<e.length?l.value?.isEnumInt?[{key:"%HasAny",name:"HasAny",value:e.map(e=>parseInt(e)).reduce((e,t)=>e+t,0).toString()}]:[{key:"%In",name:"In",value:e.join(",")}]:[]),t("save",w.value),t("done")}function O(e){w.value.sort=e===w.value.sort?void 0:e,wt(M)}return Cl(()=>w.value=Object.assign({},d.column.settings,{filters:Array.from(d.column.settings.filters)})),Cl(()=>{let e=d.column.settings.filters?.[0]?.value?.split(",")||[];if(0<e.length&&l.value?.isEnumInt){let t=e[0]&&parseInt(e[0])||0;e=l.value.enumValues?.filter(e=>0<(t&parseInt(e)))||[]}m.value=e}),(e,t)=>{var l=U("SelectInput"),r=U("TextInput"),n=U("PrimaryButton"),o=U("SecondaryButton");return a(),i("div",{class:"fixed z-20 inset-0 overflow-y-auto",onClick:V,onVnodeMounted:S},[s("div",{class:"absolute",style:is(`top:${u.topLeft.y}px;left:${u.topLeft.x}px`),onClick:t[5]||(t[5]=He(()=>{},["stop"]))},[s("div",Bi,[s("div",ji,[t[10]||(t[10]=s("h3",{class:"text-base font-medium mb-3 dark:text-gray-100"},"Sort",-1)),s("div",Oi,[s("button",{type:"button",title:"Sort Ascending",onClick:t[0]||(t[0]=e=>O("ASC")),class:g(`${"ASC"===w.value.sort?"bg-indigo-100 border-indigo-500":"bg-white hover:bg-gray-50 border-gray-300"} mr-1 inline-flex items-center px-2.5 py-1.5 border shadow-sm text-sm font-medium rounded text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500`)},[...t[6]||(t[6]=[s("svg",{class:"w-6 h-6",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},[s("g",{fill:"currentColor"},[s("path",{"fill-rule":"evenodd",d:"M10.082 5.629L9.664 7H8.598l1.789-5.332h1.234L13.402 7h-1.12l-.419-1.371h-1.781zm1.57-.785L11 2.687h-.047l-.652 2.157h1.351z"}),s("path",{d:"M12.96 14H9.028v-.691l2.579-3.72v-.054H9.098v-.867h3.785v.691l-2.567 3.72v.054h2.645V14zm-8.46-.5a.5.5 0 0 1-1 0V3.707L2.354 4.854a.5.5 0 1 1-.708-.708l2-1.999l.007-.007a.498.498 0 0 1 .7.006l2 2a.5.5 0 1 1-.707.708L4.5 3.707V13.5z"})])],-1),s("span",null,"ASC",-1)])],2),s("button",{type:"button",title:"Sort Descending",onClick:t[1]||(t[1]=e=>O("DESC")),class:g(`${"DESC"===w.value.sort?"bg-indigo-100 border-indigo-500":"bg-white hover:bg-gray-50 border-gray-300"} ml-1 inline-flex items-center px-2.5 py-1.5 border shadow-sm text-sm font-medium rounded text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500`)},[...t[7]||(t[7]=[Sl('<svg class="w-6 h-6" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g fill="currentColor"><path d="M12.96 7H9.028v-.691l2.579-3.72v-.054H9.098v-.867h3.785v.691l-2.567 3.72v.054h2.645V7z"></path><path fill-rule="evenodd" d="M10.082 12.629L9.664 14H8.598l1.789-5.332h1.234L13.402 14h-1.12l-.419-1.371h-1.781zm1.57-.785L11 9.688h-.047l-.652 2.156h1.351z"></path><path d="M4.5 2.5a.5.5 0 0 0-1 0v9.793l-1.146-1.147a.5.5 0 0 0-.708.708l2 1.999l.007.007a.497.497 0 0 0 .7-.006l2-2a.5.5 0 0 0-.707-.708L4.5 12.293V2.5z"></path></g></svg><span>DESC</span>',2)])],2)]),t[11]||(t[11]=s("h3",{class:"text-base font-medium mt-4 mb-2"}," Filter ",-1)),y.value?(a(),i("div",Hi,[(a(!0),i(Ve,null,Se(h.value,e=>(a(),i("div",{key:e.key,class:"flex items-center"},[Pt(s("input",{type:"checkbox",id:e.key,value:e.key,"onUpdate:modelValue":t[2]||(t[2]=e=>m.value=e),class:"h-4 w-4 border-gray-300 rounded text-indigo-600 focus:ring-indigo-500"},null,8,Ri),[[rs,m.value]]),s("label",{for:e.key,class:"ml-3"},T(e.value),9,Ei)]))),128))])):(a(),i("div",Ni,[(a(!0),i(Ve,null,Se(k.value,(e,l)=>(a(),i("div",zi,[s("span",Ui,[he(T(u.column.name)+" "+T(e.name)+" "+T((e=e,Vn(C(d.column.type,e.key),d.column.type,e)))+" ",1),s("button",{type:"button",onClick:e=>{var t;t=l,w.value.filters.splice(t,1)},class:"flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 hover:bg-indigo-200 hover:text-indigo-500 focus:outline-none focus:bg-indigo-500 focus:text-white"},[...t[8]||(t[8]=[s("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[s("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1)])],8,qi)])]))),256)),s("div",Qi,[pe(l,{id:"filterRule",class:"w-32 mr-1",modelValue:p.value,"onUpdate:modelValue":t[3]||(t[3]=e=>p.value=e),entries:b.value,label:"",placeholder:""},null,8,["modelValue","entries"]),"none"!==C(u.column.type,p.value)?.valueType?(a(),X(r,{key:0,ref_key:"txtFilter",ref:v,id:"filterValue",class:"w-32 mr-1",type:"text",modelValue:f.value,"onUpdate:modelValue":t[4]||(t[4]=e=>f.value=e),onKeyup:tn(L,["enter"]),label:"",placeholder:""},null,8,["modelValue"])):x("",!0),s("div",{class:"pt-1"},[s("button",{type:"button",onClick:L,class:"inline-flex items-center p-1 border border-transparent rounded-full shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"},[...t[9]||(t[9]=[s("svg",{class:"h-6 w-6",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z","clip-rule":"evenodd"})],-1)])])])])]))]),s("div",Ki,[pe(n,{onClick:M,color:"red",class:"ml-2"},{default:we(()=>[...t[12]||(t[12]=[he(" Save ",-1)])]),_:1}),pe(o,{onClick:V},{default:we(()=>[...t[13]||(t[13]=[he(" Cancel ",-1)])]),_:1})])])],4)],512)}}}),_i={class:"px-4 sm:px-6 lg:px-8 text-sm"},Zi={class:"flex flex-wrap"},Wi={class:"group pr-4 sm:pr-6 lg:pr-8"},Gi={class:"flex justify-between w-full font-medium"},Ji={class:"w-6 flex justify-end"},Xi={class:"hidden group-hover:inline"},Yi=["onClick","title"],er={key:0,class:"pt-2"},tr={class:"ml-2"},lr={key:1},sr={class:"pt-2"},nr={class:"inline-flex rounded-full items-center py-0.5 pl-2.5 pr-1 text-sm font-medium bg-indigo-100 text-indigo-700"},ar=["onClick"],Ds=ue({__name:"FilterViews",props:{definitions:{},columns:{}},emits:["done","change"],setup(e,{emit:t}){let l=e,o=t,r=c(()=>l.columns.filter(e=>0<e.settings.filters.length));function u(e,t){return(e=>{let t=l.definitions;return t=yn(e)?t:t.filter(e=>"string"!==e.types)})(e).find(e=>e.value===t)}function d(){l.columns.forEach(e=>{e.settings.filters=[],o("change",e)}),o("done")}return(e,n)=>(a(),i("div",_i,[s("div",Zi,[(a(!0),i(Ve,null,Se(r.value,r=>(a(),i("fieldset",Wi,[s("legend",Gi,[s("span",null,T(G(De)(r.name)),1),s("span",Ji,[s("span",Xi,[s("button",{onClick:e=>{var t;(t=r).settings.filters=[],o("change",t)},title:`Clear all ${G(De)(r.name)} filters`,class:"flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-red-600 hover:bg-red-200 hover:text-red-500 focus:outline-none focus:bg-red-500 focus:text-white"},[...n[0]||(n[0]=[s("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[s("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1)])],8,Yi)])])]),r.meta.isEnum?(a(),i("div",er,[(a(!0),i(Ve,null,Se(r.settings.filters?.[0]?.value?.split(","),e=>(a(),i("div",{key:e,class:"flex items-center"},[s("label",tr,T(e),1)]))),128))])):(a(),i("div",lr,[(a(!0),i(Ve,null,Se(r.settings.filters,(e,l)=>{return a(),i("div",sr,[s("span",nr,[he(T(r.name)+" "+T(e.name)+" "+T((e=e,Vn(u((t=r).type,e.value),t.type,e)))+" ",1),s("button",{type:"button",onClick:e=>{var t;(t=r).settings.filters.splice(l,1),o("change",t)},class:"flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 hover:bg-indigo-200 hover:text-indigo-500 focus:outline-none focus:bg-indigo-500 focus:text-white"},[...n[1]||(n[1]=[s("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[s("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1)])],8,ar)])]);var t}),256))]))]))),256))]),s("div",{class:"flex justify-center pt-4"},[s("button",{type:"button",onClick:d,class:"inline-flex items-center px-2.5 py-1.5 border border-gray-300 shadow-sm text-sm font-medium rounded text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"},[...n[2]||(n[2]=[s("span",null,"Clear All",-1)])])])]))}}),or={class:"bg-white dark:bg-black px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},ir={class:""},rr={class:"mt-3 text-center sm:mt-0 sm:mx-4 sm:text-left"},ur={class:"mt-4"},dr=["for"],cr=["id"],fr=["value","selected"],vr={class:"mt-4 flex items-center py-4 border-b border-gray-200 dark:border-gray-800"},mr=["id","checked"],gr=["for"],pr={class:"mt-4"},yr={class:"pb-2 px-4"},hr={class:""},br=["id","value"],wr=["for"],xr={class:"bg-gray-50 dark:bg-gray-900 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},Bs=ue({__name:"QueryPrefs",props:{id:{default:"QueryPrefs"},columns:{},prefs:{},maxLimit:{}},emits:["done","save"],setup(o,{emit:e}){let t=Ot().autoQueryGridDefaults,u=o,l=e,d=A({}),c=(Cl(()=>d.value=Object.assign({take:t.value.take,selectedColumns:[]},u.prefs)),[10,25,50,100,250,500,1e3]);function v(){l("done")}function p(){l("save",d.value)}return(e,t)=>{let l=U("PrimaryButton"),r=U("SecondaryButton"),n=U("ModalDialog");return a(),X(n,{id:o.id,onDone:v,"size-class":"w-full sm:max-w-prose"},{default:we(()=>[s("div",or,[s("div",ir,[s("div",rr,[t[3]||(t[3]=s("h3",{class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-100"},"Query Preferences",-1)),s("div",ur,[s("label",{for:o.id+"-take",class:"block text-sm font-medium text-gray-700 dark:text-gray-300"},"Results per page",8,dr),Pt(s("select",{id:o.id+"-take","onUpdate:modelValue":t[0]||(t[0]=e=>d.value.take=e),class:"mt-1 block w-full pl-3 pr-10 py-2 text-base bg-white dark:bg-black border-gray-300 dark:border-gray-700 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md"},[(a(!0),i(Ve,null,Se(c.filter(e=>null==u.maxLimit||e<=u.maxLimit),e=>(a(),i("option",{value:e,selected:e===d.value.take},T(e),9,fr))),256))],8,cr),[[fa,d.value.take]])]),s("div",vr,[s("input",{type:"radio",id:o.id+"-allColumns",onClick:t[1]||(t[1]=e=>d.value.selectedColumns=[]),checked:0===d.value.selectedColumns.length,class:"focus:ring-indigo-500 h-4 w-4 bg-white dark:bg-black text-indigo-600 dark:text-indigo-400 border-gray-300 dark:border-gray-700"},null,8,mr),s("label",{class:"ml-3 block text-gray-700 dark:text-gray-300",for:o.id+"-allColumns"},"View all columns",8,gr)]),s("div",pr,[s("div",yr,[s("div",hr,[(a(!0),i(Ve,null,Se(o.columns,e=>(a(),i("div",{key:e.name,class:"flex items-center"},[Pt(s("input",{type:"checkbox",id:e.name,value:e.name,"onUpdate:modelValue":t[2]||(t[2]=e=>d.value.selectedColumns=e),class:"h-4 w-4 bg-white dark:bg-black border-gray-300 dark:border-gray-700 rounded text-indigo-600 dark:text-indigo-400 focus:ring-indigo-500"},null,8,br),[[rs,d.value.selectedColumns]]),s("label",{for:e.name,class:"ml-3"},T(e.name),9,wr)]))),128))])])])])])]),s("div",xr,[pe(l,{onClick:p,color:"red",class:"ml-2"},{default:we(()=>[...t[4]||(t[4]=[he(" Save ",-1)])]),_:1}),pe(r,{onClick:v},{default:we(()=>[...t[5]||(t[5]=[he(" Cancel ",-1)])]),_:1})])]),_:1},8,["id"])}}}),kr={key:0},Cr={key:1},$r={key:2,class:"pt-1"},Lr={key:0},Vr={key:1},Mr={key:2},Sr={key:4},Tr={class:"pl-1 pt-1 flex flex-wrap"},Fr={class:"flex mt-1"},Ar=["title"],Ir=["disabled"],Pr=["disabled"],Dr=["disabled"],Br=["disabled"],jr={key:0,class:"flex mt-1"},Or={class:"px-4 text-lg text-black dark:text-white"},Hr={key:0},Rr={key:1},Er={key:2},Nr={class:"flex flex-wrap"},zr={key:0,class:"pl-2 mt-1"},Ur={key:1,class:"pl-2 mt-1"},qr={key:2,class:"pl-2 mt-1"},Qr={key:0,class:"w-5 h-5 mr-1 text-green-600 dark:text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Kr={key:1,class:"w-5 h-5 mr-1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},_r={key:3,class:"pl-2 mt-1"},Zr={key:4,class:"pl-2 mt-1"},Wr={class:"mr-1"},Gr={key:0,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Jr={key:1,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Xr={key:5,class:"pl-2 mt-1"},Yr=["title"],eu={class:"whitespace-nowrap"},tu={key:8},lu={key:0,class:"cursor-pointer flex justify-between items-center hover:text-gray-900 dark:hover:text-gray-50"},su={class:"mr-1 select-none"},nu={key:1,class:"flex justify-between items-center"},au={class:"mr-1 select-none"},hl=25,ou=ue({__name:"AutoQueryGrid",props:{filterDefinitions:{},id:{default:"AutoQueryGrid"},ctx:{},apis:{},type:{},prefs:{},deny:{},hide:{},selectedColumns:{},toolbarButtonClass:{},tableStyle:{},gridClass:{},grid2Class:{},grid3Class:{},grid4Class:{},tableClass:{},theadClass:{},tbodyClass:{},theadRowClass:{},theadCellClass:{},headerTitle:{},headerTitles:{},visibleFrom:{},rowClass:{},rowStyle:{},modelTitle:{},newButtonLabel:{},apiPrefs:{},canFilter:{},disableKeyBindings:{},configureField:{},skip:{default:0},create:{type:Boolean},edit:{},filters:{}},emits:["headerSelected","rowSelected","nav"],setup(f,{expose:e,emit:t}){let{config:d,autoQueryGridDefaults:v}=Ot(),p=v,l=d.value.storage,n=f,ee=t,te=Ne("client"),m=c(()=>va(n.ctx??bt.createContext({id:n.id,type:n.type,apis:n.apis}))),ae="filtering,queryString,queryFilters".split(","),le="copyApiUrl,downloadCsv,filtersView,newItem,pagingInfo,pagingNav,preferences,refresh,resetPreferences,toolbar,forms".split(","),se=c(()=>n.deny?At(ae,n.deny):At(ae,p.value.deny)),re=c(()=>n.hide?At(le,n.hide):At(le,p.value.hide));function y(e){return se.value[e]}function h(e){return re.value[e]}let b=c(()=>n.tableStyle??p.value.tableStyle),ne=c(()=>n.gridClass??ge.getGridClass(b.value)),oe=c(()=>n.grid2Class??ge.getGrid2Class(b.value)),ie=c(()=>n.grid3Class??ge.getGrid3Class(b.value)),ue=c(()=>n.grid4Class??ge.getGrid4Class(b.value)),de=c(()=>n.tableClass??ge.getTableClass(b.value)),ce=c(()=>n.theadClass??ge.getTheadClass(b.value)),ve=c(()=>n.theadRowClass??ge.getTheadRowClass(b.value)),fe=c(()=>n.theadCellClass??ge.getTheadCellClass(b.value)),w=c(()=>n.toolbarButtonClass??ge.toolbarButtonClass);function me(e,t){var a,l;return n.rowClass?n.rowClass(e,t):(a=!!W.value.AnyUpdate,l=(o.value?.name?ye(e,o.value.name):null)==M.value,ge.getTableRowClass(n.tableStyle,t,l,a))}let k=Tl(),be=Object.keys(k).map(e=>e.toLowerCase()),xe=c(()=>m.value.viewModelProps.filter(e=>be.includes(e.name.toLowerCase())||be.includes(e.name.toLowerCase()+"-header")).map(e=>e.name));function ke(){var e=_t(n.selectedColumns);return 0<e.length?e:0<xe.value.length?xe.value:[]}let Ce=c(()=>{var e=ke().map(e=>e.toLowerCase());let a=m.value.viewModelProps;return 0<e.length?e.map(t=>a.find(e=>e.name.toLowerCase()===t)).filter(e=>null!=e):a}),Te=c(()=>{let e=m.value.viewModelProps,t=ke().map(e=>e.toLowerCase()),a=0<t.length?t.map(t=>e.find(e=>e.name.toLowerCase()===t)).filter(e=>null!=e).map(e=>e.name):e.map(e=>e.name),l=_t($.value.selectedColumns).map(e=>e.toLowerCase());return 0<l.length?a.filter(e=>l.includes(e.toLowerCase())):a}),C=A([]),L=Zl(new Ge),Le=Zl(new Ge),V=A(),S=A(!1),M=A(),F=A(),I=A(!1),D=A(),j=A(n.skip),B=A(!1),$=A({take:hl}),H=A(!1),Ve=c(()=>C.value.some(e=>0<e.settings.filters.length||!!e.settings.sort)||$.value.selectedColumns),Ae=c(()=>C.value.map(e=>e.settings.filters.length).reduce((e,t)=>e+t,0)),Me=c(()=>m.value.dataModelProps),o=c(()=>m.value.dataModelPrimaryKey),P=c(()=>$.value.take??hl),E=c(()=>(L.value.response?ye(L.value.response,"results"):null)??[]),R=c(()=>(L.value.response?.total||E.value.length)??0),Oe=c(()=>0<j.value),Fe=c(()=>0<j.value),Ie=c(()=>E.value.length>=P.value),De=c(()=>E.value.length>=P.value),_=A(),z=A(),je={NoQuery:"No Query API was found"};function Be(t){if(t){if(n.canFilter)return n.canFilter(t);var e=Me.value.find(e=>e.name.toLowerCase()==t.toLowerCase());if(e)return!hn(e)}}function r(e){ee("nav",e),y("queryString")&&Ms(e)}async function q(e){j.value+=e,j.value<0&&(j.value=0);var t=Math.floor(R.value/P.value)*P.value;j.value>t&&(j.value=t),r({skip:j.value||void 0}),await u()}async function $e(e,t){var a;F.value=null,M.value=t,e&&t&&(a=al(W.value.AnyQuery,{[e]:t}),(a=await te.api(a)).succeeded)&&((a=ye(a.response,"results")?.[0])||console.warn(`API ${W.value.AnyQuery?.request.name}(${e}:${t}) returned no results`),F.value=a)}async function He(e,t){ee("rowSelected",e,t);var a=o.value?.name,l=a?ye(e,a):null;a&&l&&(r({edit:l}),$e(a,l))}function Ee(t,e){var a,l,s;y("filtering")&&(a=e.target,Be(t)&&"TD"!==a?.tagName&&(a=a?.closest("TABLE")?.getBoundingClientRect(),l=C.value.find(e=>e.name.toLowerCase()==t.toLowerCase()))&&a&&(s=a.x+318+10,D.value={column:l,topLeft:{x:Math.max(Math.floor(e.clientX+159),s),y:a.y+45}}),ee("headerSelected",t,e))}function Ue(){D.value=null}async function Re(e){var t=D.value?.column;t&&(t.settings=e,l.setItem(ot(t.name),JSON.stringify(t.settings)),await u()),D.value=null}async function _e(e){l.setItem(ot(e.name),JSON.stringify(e.settings)),await u()}async function ze(e){I.value=!1,$.value=e,l.setItem(nt(),JSON.stringify(e)),await u()}function qe(e){_.value&&(Object.assign(_.value?.model,e),Qe())}function Xe(e){Object.assign(F.value,e),Qe()}function Qe(){_.value?.forceUpdate(),z.value?.forceUpdate(),Pe()?.proxy?.$forceUpdate()}async function u(){await Ke(Je())}async function Ze(){await u()}e({update:u,search:Ke,createRequestArgs:Je,reset:ht,createDone:J,createSave:yt,editDone:K,editSave:Y,forceUpdate:Qe,setEdit:Xe,edit:F,createForm:_,editForm:z,apiPrefs:$,results:E,skip:j,take:P,total:R}),N.interceptors.has("AutoQueryGrid.new")&&N.interceptors.invoke("AutoQueryGrid.new",{props:n});let We=/iPad|iPhone|iPod/.test(navigator.userAgent);async function Ke(a){var l=W.value.AnyQuery;if(l){let e=al(l,a),t=await te.api(e);on(e=>{H.value=e,We?wt(()=>L.value=t):L.value=t})();l=ye(t.response,"results")||[];t.succeeded&&l.label}else console.error(je.NoQuery)}function Je(){let s={include:"total",take:P.value},t=_t($.value.selectedColumns||n.selectedColumns);if(0<t.length){var r=o.value;r&&!t.includes(r.name)&&(t=[r.name,...t]);let a=Me.value,l=[];t.forEach(t=>{var e=a.find(e=>e.name.toLowerCase()==t.toLowerCase());e?.ref?.selfId&&l.push(e.ref.selfId),ye(k,t)&&l.push(...a.filter(e=>e.ref?.selfId?.toLowerCase()==t.toLowerCase()).map(e=>e.name))}),l.forEach(e=>{t.includes(e)||t.push(e)}),s.fields=Wn(t).join(",")}let e=[];if(C.value.forEach(a=>{a.settings.sort&&e.push(("DESC"===a.settings.sort?"-":"")+a.name),a.settings.filters.forEach(e=>{var t=e.key.replace("%",a.name);s[t]=e.value})}),n.filters&&Object.keys(n.filters).forEach(e=>{s[e]=n.filters[e]}),y("queryString")&&y("queryFilters")){var r=location.search||(location.hash.includes("?")?"?"+bl(location.hash,"?"):"");let e=Gl(r);Object.keys(e).forEach(t=>{Ce.value.find(e=>e.name.toLowerCase()===t.toLowerCase())&&(s[t]=e[t])}),typeof e.skip<"u"&&(r=parseInt(e.skip),isNaN(r)||(s.skip=r))}return"u"<typeof s.skip&&0<j.value&&(s.skip=j.value),0<e.length&&(s.orderBy=e.join(",")),s}function Ye(){var e=at("csv");as(e),typeof window<"u"&&window.open(e)}function et(){as(at("json")),B.value=!0,setTimeout(()=>B.value=!1,3e3)}function at(e="json"){var t=Je(),a="/api/"+W.value.AnyQuery?.request.name,a=Fa(te.baseUrl,Zt(a,{...t,jsconfig:"edv"}));return 0<=a.indexOf("?")?Fl(a,"?")+"."+e+"?"+bl(a,"?"):a+".json"}async function lt(){C.value.forEach(e=>{e.settings={filters:[]},l.removeItem(ot(e.name))}),$.value={take:hl},l.removeItem(nt()),await u()}function st(){S.value=!0,r({create:null})}let Q=c(()=>m.value.dataModelName),Z=c(()=>n.modelTitle||Q.value),rt=c(()=>n.newButtonLabel||"New "+Z.value),nt=()=>m.value.prefsCacheKey(),ot=e=>m.value.columnCacheKey(e),it=Is().invalidAccessMessage,ut=c(()=>n.filterDefinitions||m.value.filterDefinitions),W=c(()=>m.value.apis),dt=e=>`<span class="text-yellow-700">${e}</span>`,ct=c(()=>{var e;return m.value.metadataApi?0<(e=m.value.invalidApis).length?dt(`Unknown API${1<e.length?"s":""}: `+e.join(", ")):(e=W.value).empty?dt("Mising DataModel in property 'type' or AutoQuery APIs to use in property 'apis'"):e.AnyQuery?null:dt(je.NoQuery):dt(`AppMetadata not loaded, see <a class="${Ml.blue}" href="https://docs.servicestack.net/vue/use-metadata" target="_blank">useMetadata()</a>`)}),vt=c(()=>W.value.AnyQuery&&it(W.value.AnyQuery)),pt=c(()=>W.value.Create&&it(W.value.Create)),ft=c(()=>W.value.AnyUpdate&&it(W.value.AnyUpdate)),mt=c(()=>nl(W.value.Create)),gt=(c(()=>nl(W.value.AnyUpdate)),c(()=>nl(W.value.Delete)));function K(){F.value=null,M.value=null,r({edit:void 0})}function J(){S.value=!1,r({create:void 0})}async function Y(){await u(),K()}async function yt(){await u(),J()}function ht(){L.value=new Ge,Le.value=new Ge,S.value=!1,M.value=null,F.value=null,I.value=!1,D.value=null,j.value=n.skip,B.value=!1,$.value={take:hl},H.value=!1;var e,t=n.prefs||Vl(l.getItem(nt())),t=(t&&($.value=t),C.value=Ce.value.map(e=>({name:e.name,type:e.type,meta:e,settings:Object.assign({filters:[]},Vl(l.getItem(ot(e.name))))})),isNaN(n.skip)||(j.value=n.skip),o.value?.name);y("queryString")&&(e=location.search||(location.hash.includes("?")?"?"+bl(location.hash,"?"):""),typeof(e=Gl(e)).create<"u"?S.value=typeof e.create<"u":!t||"string"!=typeof e.edit&&"number"!=typeof e.edit||$e(t,e.edit)),!0===n.create&&(S.value=!0),t&&null!=n.edit&&$e(t,n.edit)}return tt(async()=>{ht(),await wt(),await u()}),(l,e)=>{let t=U("Alert"),r=U("EnsureAccessDialog"),n=U("AutoCreateForm"),o=U("AutoEditForm"),u=U("AutoViewForm"),d=U("ErrorSummary"),c=U("Loading"),v=U("SettingsIcons"),p=U("DataGrid");return ct.value?(a(),i("div",kr,[pe(t,{innerHTML:ct.value},null,8,["innerHTML"])])):vt.value?(a(),i("div",Cr,[pe(ea,{"invalid-access":vt.value},null,8,["invalid-access"])])):(a(),i("div",$r,[h("forms")&&S.value&&W.value.Create?(a(),i("div",Lr,[pt.value?(a(),X(r,{key:0,title:"Create "+Z.value,"invalid-access":pt.value,"alert-class":"text-yellow-700",onDone:J},null,8,["title","invalid-access"])):G(k).createform?O(l.$slots,"createform",{key:1,type:W.value.Create.request.name,configure:f.configureField,done:J,save:yt}):(a(),X(n,{key:2,ref_key:"createForm",ref:_,type:W.value.Create.request.name,configure:f.configureField,onDone:J,onSave:yt},{header:we(()=>[O(l.$slots,"formheader",{form:"create",formInstance:_.value,apis:W.value,type:Q.value,updateModel:qe})]),footer:we(()=>[O(l.$slots,"formfooter",{form:"create",formInstance:_.value,apis:W.value,type:Q.value,updateModel:qe})]),_:3},8,["type","configure"]))])):h("forms")&&F.value&&W.value.AnyUpdate?(a(),i("div",Vr,[ft.value?(a(),X(r,{key:0,title:"Update "+Z.value,"invalid-access":ft.value,"alert-class":"text-yellow-700",onDone:K},null,8,["title","invalid-access"])):G(k).editform?O(l.$slots,"editform",{key:1,model:F.value,type:W.value.AnyUpdate.request.name,deleteType:gt.value?W.value.Delete.request.name:null,configure:f.configureField,done:K,save:Y}):(a(),X(o,{key:2,ref_key:"editForm",ref:z,modelValue:F.value,"onUpdate:modelValue":e[0]||(e[0]=e=>F.value=e),type:W.value.AnyUpdate.request.name,deleteType:gt.value?W.value.Delete.request.name:null,configure:f.configureField,onDone:K,onSave:Y,onDelete:Y},{header:we(()=>[O(l.$slots,"formheader",{form:"edit",formInstance:z.value,apis:W.value,type:Q.value,model:F.value,id:M.value,updateModel:Xe})]),footer:we(()=>[O(l.$slots,"formfooter",{form:"edit",formInstance:z.value,apis:W.value,type:Q.value,model:F.value,id:M.value,updateModel:Xe})]),_:3},8,["modelValue","type","deleteType","configure"]))])):h("forms")&&F.value?(a(),i("div",Mr,[G(k).viewform?O(l.$slots,"viewform",{key:0,model:F.value,apis:W.value,done:K}):(a(),X(u,{key:1,model:F.value,apis:W.value,deleteType:gt.value?W.value.Delete.request.name:null,done:K,onSave:Y,onDelete:Y},null,8,["model","apis","deleteType"]))])):x("",!0),G(k).toolbar?O(l.$slots,"toolbar",{key:3}):h("toolbar")?(a(),i("div",Sr,[I.value?(a(),X(Bs,{key:0,columns:Ce.value,prefs:$.value,onDone:e[1]||(e[1]=e=>I.value=!1),onSave:ze},null,8,["columns","prefs"])):x("",!0),s("div",Tr,[s("div",Fr,[h("preferences")?(a(),i("button",{key:0,type:"button",class:"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400",title:Z.value+" Preferences",onClick:e[2]||(e[2]=e=>I.value=!I.value)},[...e[9]||(e[9]=[s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("g",{"stroke-width":"1.5",fill:"none"},[s("path",{d:"M9 3H3.6a.6.6 0 0 0-.6.6v16.8a.6.6 0 0 0 .6.6H9M9 3v18M9 3h6M9 21h6m0-18h5.4a.6.6 0 0 1 .6.6v16.8a.6.6 0 0 1-.6.6H15m0-18v18",stroke:"currentColor"})])],-1)])],8,Ar)):x("",!0),h("pagingNav")?(a(),i("button",{key:1,type:"button",class:g(["pl-2",Oe.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"First page",disabled:!Oe.value,onClick:e[3]||(e[3]=e=>q(-R.value))},[...e[10]||(e[10]=[s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6l6 6zM6 6h2v12H6z",fill:"currentColor"})],-1)])],10,Ir)):x("",!0),h("pagingNav")?(a(),i("button",{key:2,type:"button",class:g(["pl-2",Fe.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Previous page",disabled:!Fe.value,onClick:e[4]||(e[4]=e=>q(-P.value))},[...e[11]||(e[11]=[s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z",fill:"currentColor"})],-1)])],10,Pr)):x("",!0),h("pagingNav")?(a(),i("button",{key:3,type:"button",class:g(["pl-2",Ie.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Next page",disabled:!Ie.value,onClick:e[5]||(e[5]=e=>q(P.value))},[...e[12]||(e[12]=[s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M10 6L8.59 7.41L13.17 12l-4.58 4.59L10 18l6-6z",fill:"currentColor"})],-1)])],10,Dr)):x("",!0),h("pagingNav")?(a(),i("button",{key:4,type:"button",class:g(["pl-2",De.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Last page",disabled:!De.value,onClick:e[6]||(e[6]=e=>q(R.value))},[...e[13]||(e[13]=[s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6l-6-6zM16 6h2v12h-2z",fill:"currentColor"})],-1)])],10,Br)):x("",!0)]),h("pagingInfo")?(a(),i("div",jr,[s("div",Or,[H.value?(a(),i("span",Hr,"Querying...")):x("",!0),E.value.length?(a(),i("span",Rr,[e[14]||(e[14]=s("span",{class:"hidden xl:inline"}," Showing Results ",-1)),he(" "+T(j.value+1)+" - "+T(Math.min(j.value+E.value.length,R.value))+" ",1),s("span",null," of "+T(R.value),1)])):L.value.completed?(a(),i("span",Er,"No Results")):x("",!0)])])):x("",!0),s("div",Nr,[h("refresh")?(a(),i("div",zr,[s("button",{type:"button",onClick:Ze,title:"Refresh",class:g(w.value)},[...e[15]||(e[15]=[s("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 20v-5h-5M4 4v5h5m10.938 2A8.001 8.001 0 0 0 5.07 8m-1.008 5a8.001 8.001  0 0 0 14.868 3"})],-1)])],2)])):x("",!0),h("downloadCsv")?(a(),i("div",Ur,[s("button",{type:"button",onClick:Ye,title:"Download CSV",class:g(w.value)},[...e[16]||(e[16]=[Sl('<svg class="w-5 h-5 mr-1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M28.781 4.405h-10.13V2.018L2 4.588v22.527l16.651 2.868v-3.538h10.13A1.162 1.162 0 0 0 30 25.349V5.5a1.162 1.162 0 0 0-1.219-1.095zm.16 21.126H18.617l-.017-1.889h2.487v-2.2h-2.506l-.012-1.3h2.518v-2.2H18.55l-.012-1.3h2.549v-2.2H18.53v-1.3h2.557v-2.2H18.53v-1.3h2.557v-2.2H18.53v-2h10.411z" fill="#20744a" fill-rule="evenodd"></path><path fill="#20744a" d="M22.487 7.439h4.323v2.2h-4.323z"></path><path fill="#20744a" d="M22.487 10.94h4.323v2.2h-4.323z"></path><path fill="#20744a" d="M22.487 14.441h4.323v2.2h-4.323z"></path><path fill="#20744a" d="M22.487 17.942h4.323v2.2h-4.323z"></path><path fill="#20744a" d="M22.487 21.443h4.323v2.2h-4.323z"></path><path fill="#fff" fill-rule="evenodd" d="M6.347 10.673l2.146-.123l1.349 3.709l1.594-3.862l2.146-.123l-2.606 5.266l2.606 5.279l-2.269-.153l-1.532-4.024l-1.533 3.871l-2.085-.184l2.422-4.663l-2.238-4.993z"></path></svg><span class="text-green-900 dark:text-green-100">Excel</span>',2)])],2)])):x("",!0),h("copyApiUrl")?(a(),i("div",qr,[s("button",{type:"button",onClick:et,title:"Copy API URL",class:g(w.value)},[B.value?(a(),i("svg",Qr,[...e[17]||(e[17]=[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)])])):(a(),i("svg",Kr,[...e[18]||(e[18]=[s("g",{fill:"none"},[s("path",{d:"M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7.242a2 2 0 0 0-.602-1.43L16.083 2.57A2 2 0 0 0 14.685 2H10a2 2 0 0 0-2 2z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),s("path",{d:"M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])),e[19]||(e[19]=s("span",{class:"whitespace-nowrap"},"Copy URL",-1))],2)])):x("",!0),Ve.value&&h("resetPreferences")?(a(),i("div",_r,[s("button",{type:"button",onClick:lt,title:"Reset Preferences & Filters",class:g(w.value)},[...e[20]||(e[20]=[s("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 24 24"},[s("path",{fill:"currentColor",d:"M6.78 2.72a.75.75 0 0 1 0 1.06L4.56 6h8.69a7.75 7.75 0 1 1-7.75 7.75a.75.75 0 0 1 1.5 0a6.25 6.25 0 1 0 6.25-6.25H4.56l2.22 2.22a.75.75 0 1 1-1.06 1.06l-3.5-3.5a.75.75 0 0 1 0-1.06l3.5-3.5a.75.75 0 0 1 1.06 0Z"})],-1)])],2)])):x("",!0),h("filtersView")&&0<Ae.value?(a(),i("div",Zr,[s("button",{type:"button",onClick:e[7]||(e[7]=e=>V.value="filters"==V.value?null:"filters"),class:g(w.value),"aria-expanded":"false"},[e[23]||(e[23]=s("svg",{class:"flex-none w-5 h-5 mr-2 text-gray-400 dark:text-gray-500 group-hover:text-gray-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[s("path",{"fill-rule":"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z","clip-rule":"evenodd"})],-1)),s("span",Wr,T(Ae.value)+" "+T(1==Ae.value?"Filter":"Filters"),1),"filters"!=V.value?(a(),i("svg",Gr,[...e[21]||(e[21]=[s("path",{"fill-rule":"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z","clip-rule":"evenodd"},null,-1)])])):(a(),i("svg",Jr,[...e[22]||(e[22]=[s("path",{"fill-rule":"evenodd",d:"M5 10a1 1 0 011-1h8a1 1 0 110 2H6a1 1 0 01-1-1z","clip-rule":"evenodd"},null,-1)])]))],2)])):x("",!0),h("newItem")&&W.value.Create&&mt.value?(a(),i("div",Xr,[s("button",{type:"button",onClick:st,title:Z.value,class:g(w.value)},[e[24]||(e[24]=s("svg",{class:"w-5 h-5 mr-1 text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-50",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z",fill:"currentColor"})],-1)),s("span",eu,T(rt.value),1)],10,Yr)])):x("",!0),G(k).toolbarbuttons?O(l.$slots,"toolbarbuttons",{key:6,toolbarButtonClass:w.value}):x("",!0)])])])):x("",!0),"filters"==V.value?(a(),X(Ds,{key:5,class:"border-y border-gray-200 dark:border-gray-800 py-8 my-2",definitions:ut.value,columns:C.value,onDone:e[8]||(e[8]=e=>V.value=null),onChange:_e},null,8,["definitions","columns"])):x("",!0),Le.value.error??L.value.error?(a(),X(d,{key:6,status:Le.value.error??L.value.error},null,8,["status"])):H.value?(a(),X(c,{key:7,class:"p-2"})):x("",!0),D.value?(a(),i("div",tu,[pe(Ps,{definitions:ut.value,column:D.value.column,"top-left":D.value.topLeft,onDone:Ue,onSave:Re},null,8,["definitions","column","top-left"])])):x("",!0),m.value?(a(),X(p,{key:9,id:f.id,items:E.value,type:Q.value,ctx:m.value,"selected-columns":Te.value,class:"mt-1",tableStyle:b.value,gridClass:ne.value,grid2Class:oe.value,grid3Class:ie.value,grid4Class:ue.value,tableClass:de.value,theadClass:ce.value,theadRowClass:ve.value,theadCellClass:fe.value,tbodyClass:f.tbodyClass,rowClass:me,onRowSelected:He,rowStyle:f.rowStyle,headerTitle:f.headerTitle,headerTitles:f.headerTitles,visibleFrom:f.visibleFrom,onHeaderSelected:Ee},us({header:we(({column:t,label:e})=>[y("filtering")&&Be(t)?(a(),i("div",lu,[s("span",su,T(e),1),pe(v,{column:C.value.find(e=>e.name.toLowerCase()===t.toLowerCase()),"is-open":D.value?.column.name===t},null,8,["column","is-open"])])):(a(),i("div",nu,[s("span",au,T(e),1)]))]),_:2},[Se(Object.keys(G(k)),t=>({name:t,fn:we(e=>[O(l.$slots,t,$l(ln(e)))])}))]),1032,["id","items","type","ctx","selected-columns","tableStyle","gridClass","grid2Class","grid3Class","grid4Class","tableClass","theadClass","theadRowClass","theadCellClass","tbodyClass","rowStyle","headerTitle","headerTitles","visibleFrom"])):x("",!0)]))}}}),iu={class:"flex"},ru={key:0,class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},uu={key:2,class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},du={key:3,class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},cu=ue({__name:"SettingsIcons",props:{column:{},isOpen:{type:Boolean}},setup(l){return(e,t)=>(a(),i("div",iu,[l.column?.settings?.filters?.length?(a(),i("svg",ru,[...t[0]||(t[0]=[s("g",{fill:"none"},[s("path",{d:"M3 4a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v2.586a1 1 0 0 1-.293.707l-6.414 6.414a1 1 0 0 0-.293.707V17l-4 4v-6.586a1 1 0 0 0-.293-.707L3.293 7.293A1 1 0 0 1 3 6.586V4z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):(a(),i("svg",{key:1,class:g(["w-4 h-4 transition-transform",l.isOpen?"rotate-180":""]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[...t[1]||(t[1]=[s("path",{d:"M505.5 658.7c3.2 4.4 9.7 4.4 12.9 0l178-246c3.8-5.3 0-12.7-6.5-12.7H643c-10.2 0-19.9 4.9-25.9 13.2L512 558.6L406.8 413.2c-6-8.3-15.6-13.2-25.9-13.2H334c-6.5 0-10.3 7.4-6.5 12.7l178 246z",fill:"currentColor"},null,-1),s("path",{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z",fill:"currentColor"},null,-1)])],2)),"ASC"===l.column?.settings?.sort?(a(),i("svg",uu,[...t[2]||(t[2]=[s("g",{fill:"none"},[s("path",{d:"M8.998 4.71L6.354 7.354a.5.5 0 1 1-.708-.707L9.115 3.18A.499.499 0 0 1 9.498 3H9.5a.5.5 0 0 1 .354.147l.01.01l3.49 3.49a.5.5 0 1 1-.707.707l-2.65-2.649V16.5a.5.5 0 0 1-1 0V4.71z",fill:"currentColor"})],-1)])])):"DESC"===l.column?.settings?.sort?(a(),i("svg",du,[...t[3]||(t[3]=[s("g",{fill:"none"},[s("path",{d:"M10.002 15.29l2.645-2.644a.5.5 0 0 1 .707.707L9.886 16.82a.5.5 0 0 1-.384.179h-.001a.5.5 0 0 1-.354-.147l-.01-.01l-3.49-3.49a.5.5 0 1 1 .707-.707l2.648 2.649V3.5a.5.5 0 0 1 1 0v11.79z",fill:"currentColor"})],-1)])])):x("",!0)]))}}),fu=ue({__name:"EnsureAccessDialog",props:{title:{},subtitle:{},invalidAccess:{},alertClass:{}},emits:["done"],setup(r){return(t,e)=>{let l=U("EnsureAccess"),s=U("SlideOver");return r.invalidAccess?(a(),X(s,{key:0,title:r.title,onDone:e[0]||(e[0]=e=>t.$emit("done")),"content-class":"relative flex-1"},us({default:we(()=>[pe(l,{alertClass:r.alertClass,invalidAccess:r.invalidAccess},null,8,["alertClass","invalidAccess"])]),_:2},[r.subtitle?{name:"subtitle",fn:we(()=>[he(T(r.subtitle),1)]),key:"0"}:void 0]),1032,["title"])):x("",!0)}}}),vu=["for"],mu=["type","name","id","placeholder","value","aria-invalid","aria-describedby"],gu={key:0,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},pu=["id"],yu=["id"],hu={inheritAttrs:!1},bu=ue({...hu,__name:"TextInput",props:{status:{},id:{},type:{},inputClass:{},filterClass:{type:Function},label:{},labelClass:{},help:{},placeholder:{},modelValue:{}},setup(l,{expose:e}){let t=l,r=(e({focus:function(){r.value?.focus()}}),A());let n=c(()=>t.type||"text"),o=c(()=>t.label??De(ut(t.id))),u=c(()=>t.placeholder??o.value);function d(e){return"range"===t.type?e.replace("shadow-sm ",""):e}let v=Ne("ApiState",void 0),p=c(()=>pt.call({responseStatus:t.status??v?.error.value},t.id)),f=c(()=>Ct([rt.base,p.value?rt.invalid:d(rt.valid),t.inputClass],"TextInput",t.filterClass));return(t,e)=>(a(),i("div",{class:g([t.$attrs.class])},[O(t.$slots,"header",Ce({inputElement:r.value,id:l.id,modelValue:l.modelValue,status:l.status},t.$attrs)),o.value?(a(),i("label",{key:0,for:l.id,class:g("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(l.labelClass??""))},T(o.value),11,vu)):x("",!0),s("div",{class:g(d("mt-1 relative"))},[s("input",Ce({ref_key:"inputElement",ref:r,type:n.value,name:l.id,id:l.id,class:f.value,placeholder:u.value,value:G(ss)(n.value,l.modelValue),onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",(e=e.target,ss(n.value,e.value)))),"aria-invalid":null!=p.value,"aria-describedby":l.id+"-error",step:"any"},G(ft)(t.$attrs,["class","value"])),null,16,mu),p.value?(a(),i("div",gu,[...e[1]||(e[1]=[s("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1)])])):x("",!0)],2),p.value?(a(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:l.id+"-error"},T(p.value),9,pu)):l.help?(a(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:l.id+"-description"},T(l.help),9,yu)):x("",!0),O(t.$slots,"footer",Ce({inputElement:r.value,id:l.id,modelValue:l.modelValue,status:l.status},t.$attrs))],2))}}),wu=["for"],xu={class:"mt-1 relative"},ku=["name","id","placeholder","aria-invalid","aria-describedby"],Cu=["id"],$u=["id"],Lu={inheritAttrs:!1},Vu=ue({...Lu,__name:"TextareaInput",props:{status:{},id:{},inputClass:{},filterClass:{type:Function},label:{},labelClass:{},help:{},placeholder:{},modelValue:{}},setup(l){let e=l,r=c(()=>e.label??De(ut(e.id))),n=c(()=>e.placeholder??r.value),t=Ne("ApiState",void 0),o=c(()=>pt.call({responseStatus:e.status??t?.error.value},e.id)),u=c(()=>Ct(["shadow-sm "+rt.base,o.value?"text-red-900 focus:ring-red-500 focus:border-red-500 border-red-300":"text-gray-900 "+rt.valid,e.inputClass],"TextareaInput",e.filterClass));return(t,e)=>(a(),i("div",{class:g([t.$attrs.class])},[r.value?(a(),i("label",{key:0,for:l.id,class:g("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(l.labelClass??""))},T(r.value),11,wu)):x("",!0),s("div",xu,[s("textarea",Ce({name:l.id,id:l.id,class:u.value,placeholder:n.value,onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.value)),"aria-invalid":null!=o.value,"aria-describedby":l.id+"-error"},G(ft)(t.$attrs,["class"])),T(l.modelValue),17,ku)]),o.value?(a(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:l.id+"-error"},T(o.value),9,Cu)):l.help?(a(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:l.id+"-description"},T(l.help),9,$u)):x("",!0)],2))}}),Mu=["for"],Su=["id","name","value","aria-invalid","aria-describedby"],Tu=["value"],Fu=["id"],Au={inheritAttrs:!1},Iu=ue({...Au,__name:"SelectInput",props:{status:{},id:{},modelValue:{},inputClass:{},filterClass:{type:Function},label:{},labelClass:{},options:{},values:{},entries:{}},setup(l){let t=l,r=c(()=>t.label??De(ut(t.id))),e=Ne("ApiState",void 0),n=c(()=>pt.call({responseStatus:t.status??e?.error.value},t.id)),o=c(()=>t.entries||(t.values?t.values.map(e=>({key:e,value:e})):t.options?Object.keys(t.options).map(e=>({key:e,value:t.options[e]})):[])),u=c(()=>Ct(["mt-1 block w-full pl-3 pr-10 py-2 text-base focus:outline-none sm:text-sm rounded-md dark:text-white dark:bg-gray-900 dark:border-gray-600 disabled:bg-slate-50 dark:disabled:bg-slate-900 disabled:text-slate-500 disabled:border-slate-200 dark:disabled:border-slate-700 disabled:shadow-none",n.value?"border-red-300 text-red-900 focus:ring-red-500 focus:border-red-500":"shadow-sm border-gray-300 text-gray-900 focus:ring-indigo-500 focus:border-indigo-500",t.inputClass],"SelectInput",t.filterClass));return(t,e)=>(a(),i("div",{class:g([t.$attrs.class])},[r.value?(a(),i("label",{key:0,for:l.id,class:g("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(l.labelClass??""))},T(r.value),11,Mu)):x("",!0),s("select",Ce({id:l.id,name:l.id,class:u.value,value:l.modelValue,onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.value)),"aria-invalid":null!=n.value,"aria-describedby":l.id+"-error"},G(ft)(t.$attrs,["class"])),[(a(!0),i(Ve,null,Se(o.value,e=>(a(),i("option",{value:e.key},T(e.value),9,Tu))),256))],16,Su),n.value?(a(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:l.id+"-error"},T(n.value),9,Fu)):x("",!0)],2))}}),Pu={class:"flex items-center h-5"},Du=["id","name","checked"],Bu={class:"ml-3 text-sm"},ju=["for"],Ou={key:0,class:"mt-2 text-sm text-red-500",id:"`${id}-error`"},Hu={key:1,class:"mt-2 text-sm text-gray-500",id:"`${id}-description`"},Ru={inheritAttrs:!1},Eu=ue({...Ru,__name:"CheckboxInput",props:{modelValue:{type:Boolean},status:{},id:{},inputClass:{},filterClass:{type:Function},label:{},labelClass:{},help:{}},emits:["update:modelValue"],setup(l,{}){let e=l,r=c(()=>e.label??De(ut(e.id))),t=Ne("ApiState",void 0),n=c(()=>pt.call({responseStatus:e.status??t?.error.value},e.id)),o=c(()=>Ct(["focus:ring-indigo-500 h-4 w-4 text-indigo-600 rounded border-gray-300 dark:border-gray-600 dark:bg-gray-800",e.inputClass],"CheckboxInput",e.filterClass));return(t,e)=>(a(),i("div",{class:g(["relative flex items-start",t.$attrs.class])},[s("div",Pu,[s("input",Ce({id:l.id,name:l.id,type:"checkbox",checked:l.modelValue,onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.checked)),class:o.value},G(ft)(t.$attrs,["class"])),null,16,Du)]),s("div",Bu,[s("label",{for:l.id,class:g("font-medium text-gray-700 dark:text-gray-300 "+(l.labelClass??""))},T(r.value),11,ju),n.value?(a(),i("p",Ou,T(n.value),1)):l.help?(a(),i("p",Hu,T(l.help),1)):x("",!0)])],2))}}),Nu=["id"],zu=["for"],Uu={class:"mt-1 relative"},qu=["id","name","value"],Qu={class:"flex flex-wrap pb-1.5"},Ku={class:"pt-1.5 pl-1"},_u={class:"inline-flex rounded-full items-center py-0.5 pl-2.5 pr-1 text-sm font-medium bg-indigo-100 dark:bg-indigo-800 text-indigo-700 dark:text-indigo-300"},Zu=["onClick"],Wu={class:"pt-1.5 pl-1 shrink"},Gu=["type","name","id","aria-invalid","aria-describedby"],Ju=["id"],Xu=["onMouseover","onClick"],Yu={class:"block truncate"},ed={key:1,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},td=["id"],ld=["id"],sd={inheritAttrs:!1},nd=ue({...sd,__name:"TagInput",props:{status:{},id:{},type:{},inputClass:{},filterClass:{},label:{},labelClass:{},help:{},modelValue:{default:()=>[]},delimiters:{default:()=>[","]},allowableValues:{},string:{type:Boolean},maxVisibleItems:{default:300},converter:{}},emits:["update:modelValue"],setup(t,{emit:e}){let l=t,r=e;let n=c(()=>{return Ee((e=l.modelValue,l.converter?l.converter(e):e),e=>"string"==typeof e?0==e.trim().length?[]:e.split(","):e)||[];var e}),o=A(),u=A(!1),d=c(()=>{let t=p.value.toLowerCase();return l.allowableValues&&0!=l.allowableValues.length?l.allowableValues.length<1e3?l.allowableValues.filter(e=>!n.value.includes(e)&&e.toLowerCase().includes(t)):l.allowableValues.filter(e=>!n.value.includes(e)&&e.startsWith(t)):[]});let v=A(null),p=A(""),f=c(()=>l.type||"text"),m=c(()=>l.label??De(ut(l.id))),y=Ne("ApiState",void 0),h=c(()=>pt.call({responseStatus:l.status??y?.error.value},l.id)),b=c(()=>Ct(["w-full cursor-text flex flex-wrap sm:text-sm rounded-md dark:text-white dark:bg-gray-900 border focus-within:border-transparent focus-within:ring-1 focus-within:outline-none",h.value?"pr-10 border-red-300 text-red-900 placeholder-red-300 focus-within:outline-none focus-within:ring-red-500 focus-within:border-red-500":"shadow-sm border-gray-300 dark:border-gray-600 focus-within:ring-indigo-500 focus-within:border-indigo-500",l.inputClass],"TagInput",l.filterClass)),w=t=>S(n.value.filter(e=>e!=t));function k(e){document.activeElement===e.target&&v.value?.focus()}let C=A();function L(){u.value=!0,C.value=!0}function V(){j(O()),C.value=!1,setTimeout(()=>{C.value||(u.value=!1)},200)}function S(e){var t=l.string?e.join(","):e;r("update:modelValue",t)}function M(e){var t;"Backspace"==e.key&&0==p.value.length&&0<n.value.length&&w(n.value[n.value.length-1]),l.allowableValues&&0!=l.allowableValues.length&&("Escape"==e.code||"Tab"==e.code?u.value=!1:"Home"==e.code?(o.value=d.value[0],N()):"End"==e.code?(o.value=d.value[d.value.length-1],N()):"ArrowDown"==e.code?(u.value=!0,o.value?(t=d.value.indexOf(o.value),o.value=t+1<d.value.length?d.value[t+1]:d.value[0]):o.value=d.value[0],D()):"ArrowUp"==e.code?(o.value?(t=d.value.indexOf(o.value),o.value=0<=t-1?d.value[t-1]:d.value[d.value.length-1]):o.value=d.value[d.value.length-1],D()):"Enter"==e.code?o.value&&u.value?(j(o.value),e.preventDefault()):u.value=!1:u.value=0<d.value.length)}function O(){if(0==p.value.length)return"";let e=Aa(p.value.trim(),",");return 0==(e=(e=","==e[0]?e.substring(1):e).trim()).length&&u.value&&0<d.value.length?o.value:e}function F(t){var e,a=O();0<a.length&&((e=l.delimiters.some(e=>e==t.key))&&t.preventDefault(),"Enter"==t.key||"NumpadEnter"==t.key||1==t.key.length&&e)&&j(a)}let I={behavior:"smooth",block:"nearest",inline:"nearest",scrollMode:"if-needed"};function N(){setTimeout(()=>{var e=Ll(`#${l.id}-tag li.active`);e&&e.scrollIntoView(I)},0)}function D(){setTimeout(()=>{var e=Ll(`#${l.id}-tag li.active`);e&&("scrollIntoViewIfNeeded"in e?e.scrollIntoViewIfNeeded(I):e.scrollIntoView(I))},0)}function j(e){var t;0!==e.length&&(-1==(t=Array.from(n.value)).indexOf(e)&&t.push(e),S(t),p.value="",u.value=!1)}function B(a){a=a.clipboardData?.getData("Text");if(a){let e=new RegExp("\\n|\\t|"+l.delimiters.join("|")),t=Array.from(n.value);a.split(e).map(e=>e.trim()).forEach(e=>{-1==t.indexOf(e)&&t.push(e)}),S(t),p.value=""}}return(e,l)=>(a(),i("div",{class:g([e.$attrs.class]),id:t.id+"-tag",onmousemove:"cancelBlur=true"},[m.value?(a(),i("label",{key:0,for:t.id,class:g("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(t.labelClass??""))},T(m.value),11,zu)):x("",!0),s("div",Uu,[s("input",{type:"hidden",id:t.id,name:t.id,value:n.value.join(",")},null,8,qu),s("button",{class:g(b.value),onClick:He(k,["prevent"]),onFocus:l[2]||(l[2]=e=>u.value=!0),tabindex:"-1"},[s("div",Qu,[(a(!0),i(Ve,null,Se(n.value,t=>(a(),i("div",Ku,[s("span",_u,[he(T(t)+" ",1),s("button",{type:"button",onClick:e=>w(t),class:"flex-shrink-0 ml-1 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 dark:text-indigo-500 hover:bg-indigo-200 dark:hover:bg-indigo-800 hover:text-indigo-500 dark:hover:text-indigo-400 focus:outline-none focus:bg-indigo-500 focus:text-white dark:focus:text-black"},[...l[3]||(l[3]=[s("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[s("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1)])],8,Zu)])]))),256)),s("div",Wu,[Pt(s("input",Ce({ref_key:"txtInput",ref:v,type:f.value,role:"combobox","aria-controls":"options","aria-expanded":"false",autocomplete:"off",spellcheck:"false",name:t.id+"-txt",id:t.id+"-txt",class:"p-0 dark:bg-transparent rounded-md border-none focus:!border-none focus:!outline-none",style:`box-shadow:none !important;width:${p.value.length+1}ch`,"onUpdate:modelValue":l[0]||(l[0]=e=>p.value=e),"aria-invalid":null!=h.value,"aria-describedby":t.id+"-error",onKeydown:M,onKeypress:F,onPaste:He(B,["prevent","stop"]),onFocus:L,onBlur:V,onClick:l[1]||(l[1]=e=>u.value=!0)},G(ft)(e.$attrs,["class","required"])),null,16,Gu),[[ma,p.value]])])])],34),u.value&&d.value.length?(a(),i("ul",{key:0,class:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white dark:bg-black py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm",onKeydown:M,id:t.id+"-options",role:"listbox"},[(a(!0),i(Ve,null,Se(d.value.slice(0,t.maxVisibleItems),l=>(a(),i("li",{class:g([l===o.value?"active bg-indigo-600 text-white":"text-gray-900 dark:text-gray-100","relative cursor-default select-none py-2 pl-3 pr-9"]),onMouseover:e=>{var t;t=l,o.value=t},onClick:e=>j(l),role:"option",tabindex:"-1"},[s("span",Yu,T(l),1)],42,Xu))),256))],40,Ju)):x("",!0),h.value?(a(),i("div",ed,[...l[4]||(l[4]=[s("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1)])])):x("",!0)]),h.value?(a(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:t.id+"-error"},T(h.value),9,td)):t.help?(a(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:t.id+"-description"},T(t.help),9,ld)):x("",!0)],10,Nu))}}),ad={class:"relative flex-grow mr-2 sm:mr-4"},od=["for"],id={class:"block mt-2"},rd={class:"sr-only"},ud=["multiple","name","id","placeholder","aria-invalid","aria-describedby"],dd={key:0,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},cd=["id"],fd=["id"],vd={key:0},md=["title"],gd=["alt","src"],pd={key:1,class:"mt-3"},yd={class:"w-full"},hd={class:"pr-6 align-bottom pb-2"},bd=["title"],wd=["src","onError"],xd=["href"],kd={key:1,class:"overflow-hidden"},Cd={class:"align-top pb-2 whitespace-nowrap"},$d={key:0,class:"text-gray-500 dark:text-gray-400 text-sm bg-white dark:bg-black"},Ld=ue({__name:"FileInput",props:{multiple:{type:Boolean},status:{},id:{},inputClass:{},filterClass:{type:Function},label:{},labelClass:{},help:{},placeholder:{},modelValue:{},values:{},files:{}},setup(l){let t=l,r=A(null),{assetsPathResolver:n,fallbackPathResolver:o}=Ot(),u={},d=A(),v=A(t.files?.map(e)||[]);function e(e){return e.filePath=n(e.filePath),e}t.values&&0<t.values.length&&(v.value=t.values.map(e=>{var t=e.replace(/\\/g,"/");return{fileName:an(Dt(t,"/"),"."),filePath:t,contentType:Yl(t)}}).map(e));let p=c(()=>t.label??De(ut(t.id))),f=c(()=>t.placeholder??p.value),m=Ne("ApiState",void 0),y=c(()=>pt.call({responseStatus:t.status??m?.error.value},t.id)),h=c(()=>Ct(["block w-full sm:text-sm rounded-md dark:text-white dark:bg-gray-900 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-violet-50 dark:file:bg-violet-900 file:text-violet-700 dark:file:text-violet-200 hover:file:bg-violet-100 dark:hover:file:bg-violet-800",y.value?"pr-10 border-red-300 text-red-900 placeholder-red-300 focus:outline-none focus:ring-red-500 focus:border-red-500":"text-slate-500 dark:text-slate-400",t.inputClass],"FileInput",t.filterClass)),b=e=>{var t=e.target;d.value="",v.value=Array.from(t.files||[]).map(e=>({fileName:e.name,filePath:vs(e),contentLength:e.size,contentType:e.type||Yl(e.name)}))},w=()=>r.value?.click(),k=e=>null!=e&&(e.startsWith("data:")||e.startsWith("blob:")),C=c(()=>{var e;return 0<v.value.length?v.value[0].filePath:(e="string"==typeof t.modelValue?t.modelValue:t.values&&t.values[0])&&Tt(n(e))||null}),L=e=>!e||e.startsWith("data:")||e.endsWith(".svg")?"":"rounded-full object-cover";function V(e){d.value=o(C.value)}return jt(vn),(e,t)=>(a(),i("div",{class:g(["flex",l.multiple?"flex-col":"justify-between"])},[s("div",ad,[p.value?(a(),i("label",{key:0,for:l.id,class:g("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(l.labelClass??""))},T(p.value),11,od)):x("",!0),s("div",id,[s("span",rd,T(l.help??p.value),1),s("input",Ce({ref_key:"input",ref:r,type:"file",multiple:l.multiple,name:l.id,id:l.id,class:h.value,placeholder:f.value,"aria-invalid":null!=y.value,"aria-describedby":l.id+"-error"},e.$attrs,{onChange:b}),null,16,ud),y.value?(a(),i("div",dd,[...t[0]||(t[0]=[s("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1)])])):x("",!0)]),y.value?(a(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:l.id+"-error"},T(y.value),9,cd)):l.help?(a(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:l.id+"-description"},T(l.help),9,fd)):x("",!0)]),l.multiple?(a(),i("div",pd,[s("table",yd,[(a(!0),i(Ve,null,Se(v.value,t=>(a(),i("tr",null,[s("td",hd,[s("div",{class:"flex w-full",title:k(t.filePath)?"":t.filePath},[s("img",{src:u[G(Tt)(t.filePath)]||G(n)(G(Tt)(t.filePath)),class:g(["mr-2 h-8 w-8",L(t.filePath)]),onError:e=>u[G(Tt)(t.filePath)]=G(o)(G(Tt)(t.filePath))},null,42,wd),k(t.filePath)?(a(),i("span",kd,T(t.fileName),1)):(a(),i("a",{key:0,href:G(n)(t.filePath||""),target:"_blank",class:"overflow-hidden"},T(t.fileName),9,xd))],8,bd)]),s("td",Cd,[t.contentLength&&0<t.contentLength?(a(),i("span",$d,T(G(gs)(t.contentLength)),1)):x("",!0)])]))),256))])])):(a(),i("div",vd,[C.value?(a(),i("div",{key:0,class:"shrink-0 cursor-pointer",title:k(C.value)?"":C.value},[s("img",{onClick:w,class:g(["h-16 w-16",L(C.value)]),alt:"Current "+(p.value??""),src:d.value||G(n)(C.value),onError:V},null,42,gd)],8,md)):x("",!0)]))],2))}}),Vd=["id"],Md=["for"],Sd={class:"relative mt-1"},Td=["id","placeholder","readonly"],Fd=["id"],Ad=["onMouseover","onClick"],Id={key:2,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none",tabindex:"-1"},Pd=["id"],Dd=["id"],Bd=ue({__name:"Autocomplete",props:{status:{},id:{},type:{},label:{},help:{},placeholder:{},multiple:{type:Boolean,default:!1},required:{type:Boolean},options:{default:()=>[]},modelValue:{},match:{},viewCount:{default:100},pageSize:{default:8}},emits:["update:modelValue"],setup(l,{expose:e,emit:t}){let r=A(!1),n=l,o=t;function u(e){return Array.isArray(n.modelValue)&&0<=n.modelValue.indexOf(e)}e({toggle:D});let d=c(()=>n.label??De(ut(n.id))),v=Ne("ApiState",void 0),p=c(()=>pt.call({responseStatus:n.status??v?.error.value},n.id)),f=c(()=>[rt.base,p.value?rt.invalid:rt.valid]),m=A(null),y=A(""),h=A(null),b=A(n.viewCount),w=A([]),k=c(()=>y.value?n.options.filter(e=>n.match(e,y.value)).slice(0,b.value):n.options),C=["Tab","Escape","ArrowDown","ArrowUp","Enter","PageUp","PageDown","Home","End"];let L=[",",`
`,"\t"];function V(e){var t=e.clipboardData?.getData("Text");if(t){var a=L.some(e=>t.includes(e));if(n.multiple&&a){if(a){a=new RegExp("\\r|\\n|\\t|,"),a=t.split(a).filter(e=>e.trim()).map(t=>n.options.find(e=>n.match(e,t))).filter(e=>!!e);if(0<a.length){y.value="",r.value=!1,h.value=null;let e=Array.from(n.modelValue||[]);a.forEach(t=>{u(t)?e=e.filter(e=>e!=t):e.push(t)}),o("update:modelValue",e),kl()}}}else{a=n.options.filter(e=>n.match(e,t));1==a.length&&($(a[0]),r.value=!1,kl())}}}function S(e){C.indexOf(e.code)||B()}function M(e){var t;e.shiftKey||e.ctrlKey||e.altKey||(r.value?"Escape"==e.code?r.value&&(e.stopPropagation(),r.value=!1):"Tab"==e.code?r.value=!1:"Home"==e.code?(h.value=w.value[0],I()):"End"==e.code?(h.value=w.value[w.value.length-1],I()):"ArrowDown"==e.code?(h.value?(t=w.value.indexOf(h.value),h.value=t+1<w.value.length?w.value[t+1]:w.value[0]):h.value=w.value[0],N()):"ArrowUp"==e.code?(h.value?(t=w.value.indexOf(h.value),h.value=0<=t-1?w.value[t-1]:w.value[w.value.length-1]):h.value=w.value[w.value.length-1],N()):"Enter"==e.code&&(h.value?($(h.value),n.multiple||(e.preventDefault(),kl())):r.value=!1):"ArrowDown"==e.code&&(r.value=!0,h.value=w.value[0]))}let F={behavior:"smooth",block:"nearest",inline:"nearest",scrollMode:"if-needed"};function I(){setTimeout(()=>{var e=Ll(`#${n.id}-autocomplete li.active`);e&&e.scrollIntoView(F)},0)}function N(){setTimeout(()=>{var e=Ll(`#${n.id}-autocomplete li.active`);e&&("scrollIntoViewIfNeeded"in e?e.scrollIntoViewIfNeeded(F):e.scrollIntoView(F))},0)}function D(e){(r.value=e)&&(H(),m.value?.focus())}function j(){!n.multiple&&n.modelValue?(r.value=!r.value,r.value&&H()):B()}function B(){r.value=!0,H()}function $(t){if(y.value="",r.value=!1,n.multiple){let e=Array.from(n.modelValue||[]);u(t)?e=e.filter(e=>e!=t):e.push(t),h.value=null,o("update:modelValue",e)}else o("update:modelValue",t)}function H(){w.value=k.value}return kt(y,H),(e,t)=>(a(),i("div",{id:l.id+"-autocomplete"},[d.value?(a(),i("label",{key:0,for:l.id+"-text",class:"block text-sm font-medium text-gray-700 dark:text-gray-300"},T(d.value),9,Md)):x("",!0),s("div",Sd,[Pt(s("input",Ce({ref_key:"txtInput",ref:m,id:l.id+"-text",type:"text",role:"combobox","aria-controls":"options","aria-expanded":"false",autocomplete:"off",spellcheck:"false","onUpdate:modelValue":t[0]||(t[0]=e=>y.value=e),class:f.value,placeholder:l.multiple||!l.modelValue?l.placeholder:"",readonly:!l.multiple&&!!l.modelValue&&!r.value,onKeydown:M,onKeyup:S,onClick:j,onPaste:V,required:!1},e.$attrs),null,16,Td),[[ga,y.value]]),s("button",{type:"button",onClick:t[1]||(t[1]=e=>D(!r.value)),class:"absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none",tabindex:"-1"},[...t[2]||(t[2]=[s("svg",{class:"h-5 w-5 text-gray-400 dark:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M10 3a.75.75 0 01.55.24l3.25 3.5a.75.75 0 11-1.1 1.02L10 4.852 7.3 7.76a.75.75 0 01-1.1-1.02l3.25-3.5A.75.75 0 0110 3zm-3.76 9.2a.75.75 0 011.06.04l2.7 2.908 2.7-2.908a.75.75 0 111.1 1.02l-3.25 3.5a.75.75 0 01-1.1 0l-3.25-3.5a.75.75 0 01.04-1.06z","clip-rule":"evenodd"})],-1)])]),r.value?(a(),i("ul",{key:0,class:"absolute z-20 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white dark:bg-black py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm",onKeydown:M,id:l.id+"-options",role:"listbox"},[(a(!0),i(Ve,null,Se(w.value,l=>(a(),i("li",{class:g([l===h.value?"active bg-indigo-600 text-white":"text-gray-900 dark:text-gray-100","relative cursor-default select-none py-2 pl-3 pr-9"]),onMouseover:e=>{return t=l,h.value=t,void(w.value.indexOf(t)>Math.floor(.9*b.value)&&(b.value+=n.viewCount,H()));var t},onClick:e=>$(l),role:"option",tabindex:"-1"},[O(e.$slots,"item","string"==typeof l?Ce({key:0,ref_for:!0},{key:l,value:l}):Ce({key:1,ref_for:!0},l)),u(l)?(a(),i("span",{key:2,class:g(["absolute inset-y-0 right-0 flex items-center pr-4",l===h.value?"text-white":"text-indigo-600"])},[...t[3]||(t[3]=[s("svg",{class:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z","clip-rule":"evenodd"})],-1)])],2)):x("",!0)],42,Ad))),256))],40,Fd)):!l.multiple&&l.modelValue?(a(),i("div",{key:1,onKeydown:M,class:"h-8 -mt-8 ml-3 pt-0.5 pointer-events-none"},["string"==typeof l.modelValue?O(e.$slots,"item",$l(Ce({key:0},{key:l.modelValue,value:l.modelValue}))):O(e.$slots,"item",$l(Ce({key:1},l.modelValue)))],32)):x("",!0),p.value?(a(),i("div",Id,[...t[4]||(t[4]=[s("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1)])])):x("",!0)]),p.value?(a(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:l.id+"-error"},T(p.value),9,Pd)):l.help?(a(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:l.id+"-description"},T(l.help),9,Dd)):x("",!0)],8,Vd))}}),jd=["id","name","value"],Od={class:"block truncate"},Hd=ue({__name:"Combobox",props:{id:{},modelValue:{},multiple:{type:Boolean},options:{},values:{},entries:{}},emits:["update:modelValue"],setup(r,{expose:e,emit:t}){let l=r,n=(e({toggle(e){d.value?.toggle(e)}}),t);function o(e){n("update:modelValue",e)}let u=c(()=>null!=l.multiple?l.multiple:Array.isArray(l.modelValue)),d=A();function v(e,t){return!t||e.value.toLowerCase().includes(t.toLowerCase())}let p=c(()=>l.entries||(l.values?l.values.map(e=>({key:e,value:e})):l.options?Object.keys(l.options).map(e=>({key:e,value:l.options[e]})):[])),f=A(u.value?[]:null);tt(function(){let t=l.modelValue&&"object"==typeof l.modelValue&&!Array.isArray(l.modelValue)?l.modelValue.key:l.modelValue;null==t||""===t?f.value=u.value?[]:null:"string"==typeof t?f.value=p.value.find(e=>e.key===t)||null:Array.isArray(t)&&(f.value=p.value.filter(e=>t.includes(e.key)))});let m=c(()=>null==f.value?"":Array.isArray(f.value)?f.value.map(e=>encodeURIComponent(e.key)).join(","):f.value.key);return(e,t)=>{var l=U("Autocomplete");return a(),i(Ve,null,[s("input",{type:"hidden",id:r.id,name:r.id,value:m.value},null,8,jd),pe(l,Ce({ref_key:"input",ref:d,id:r.id,options:p.value,match:v,multiple:u.value},e.$attrs,{modelValue:f.value,"onUpdate:modelValue":[t[0]||(t[0]=e=>f.value=e),o]}),{item:we(({value:e})=>[s("span",Od,T(e),1)]),_:1},16,["id","options","multiple","modelValue"])],64)}}}),Rd=ue({__name:"DynamicInput",props:{input:{},modelValue:{},api:{}},emits:["update:modelValue"],setup(v,{emit:e}){let t=v,l=e,p=c(()=>t.input.type||"text"),s="ignore,css,options,meta,allowableValues,allowableEntries,op,prop,type,id,name".split(","),f=c(()=>ft(t.input,s)),m=A("file"===p.value?null:t.modelValue[t.input.id]),g=(kt(m,()=>{t.modelValue[t.input.id]=m.value,l("update:modelValue",t.modelValue)}),c(()=>{var e=t.modelValue[t.input.id];if("file"!==t.input.type||!e)return[];if("string"==typeof e)return[{filePath:e,fileName:Dt(e,"/")}];if(!Array.isArray(e)&&"object"==typeof e)return e;if(Array.isArray(e)){let t=[];return e.forEach(e=>{"string"==typeof e?t.push({filePath:e,fileName:Dt(e,"/")}):"object"==typeof e&&t.push(e)}),t}}));return(e,t)=>{var l=U("SelectInput"),s=U("CheckboxInput"),r=U("TagInput"),n=U("Combobox"),o=U("FileInput"),i=U("TextareaInput"),u=U("MarkdownInput"),d=U("TextInput");return G(N).component(p.value)?(a(),X(sn(G(N).component(p.value)),Ce({key:0,id:v.input.id,modelValue:m.value,"onUpdate:modelValue":t[0]||(t[0]=e=>m.value=e),status:v.api?.error,"input-class":v.input.css?.input,"label-class":v.input.css?.label},f.value),null,16,["id","modelValue","status","input-class","label-class"])):"select"==p.value?(a(),X(l,Ce({key:1,id:v.input.id,modelValue:m.value,"onUpdate:modelValue":t[1]||(t[1]=e=>m.value=e),status:v.api?.error,"input-class":v.input.css?.input,"label-class":v.input.css?.label,entries:v.input.allowableEntries,values:v.input.allowableValues},f.value),null,16,["id","modelValue","status","input-class","label-class","entries","values"])):"checkbox"==p.value?(a(),X(s,Ce({key:2,id:v.input.id,modelValue:m.value,"onUpdate:modelValue":t[2]||(t[2]=e=>m.value=e),status:v.api?.error,"input-class":v.input.css?.input,"label-class":v.input.css?.label},f.value),null,16,["id","modelValue","status","input-class","label-class"])):"tag"==p.value?(a(),X(r,Ce({key:3,id:v.input.id,modelValue:m.value,"onUpdate:modelValue":t[3]||(t[3]=e=>m.value=e),status:v.api?.error,"input-class":v.input.css?.input,"label-class":v.input.css?.label,allowableValues:v.input.allowableValues,string:"String"==v.input.prop?.type},f.value),null,16,["id","modelValue","status","input-class","label-class","allowableValues","string"])):"combobox"==p.value?(a(),X(n,Ce({key:4,id:v.input.id,modelValue:m.value,"onUpdate:modelValue":t[4]||(t[4]=e=>m.value=e),status:v.api?.error,"input-class":v.input.css?.input,"label-class":v.input.css?.label,entries:v.input.allowableEntries,values:v.input.allowableValues},f.value),null,16,["id","modelValue","status","input-class","label-class","entries","values"])):"file"==p.value?(a(),X(o,Ce({key:5,id:v.input.id,status:v.api?.error,modelValue:m.value,"onUpdate:modelValue":t[5]||(t[5]=e=>m.value=e),"input-class":v.input.css?.input,"label-class":v.input.css?.label,files:g.value},f.value),null,16,["id","status","modelValue","input-class","label-class","files"])):"textarea"==p.value?(a(),X(i,Ce({key:6,id:v.input.id,modelValue:m.value,"onUpdate:modelValue":t[6]||(t[6]=e=>m.value=e),status:v.api?.error,"input-class":v.input.css?.input,"label-class":v.input.css?.label},f.value),null,16,["id","modelValue","status","input-class","label-class"])):"MarkdownInput"==p.value?(a(),X(u,Ce({key:7,id:v.input.id,modelValue:m.value,"onUpdate:modelValue":t[7]||(t[7]=e=>m.value=e),status:v.api?.error,"input-class":v.input.css?.input,"label-class":v.input.css?.label},f.value),null,16,["id","modelValue","status","input-class","label-class"])):(a(),X(d,Ce({key:8,type:p.value,id:v.input.id,modelValue:m.value,"onUpdate:modelValue":t[8]||(t[8]=e=>m.value=e),status:v.api?.error,"input-class":v.input.css?.input,"label-class":v.input.css?.label},f.value),null,16,["type","id","modelValue","status","input-class","label-class"]))}}}),Ed={class:"lookup-field"},Nd=["name","value"],zd={key:0,class:"flex justify-between"},Ud=["for"],qd={key:0,class:"flex items-center"},Qd={class:"text-sm text-gray-500 dark:text-gray-400 pr-1"},Kd={key:1,class:"mt-1 relative"},_d={class:"w-full inline-flex truncate"},Zd={class:"text-blue-700 dark:text-blue-300 flex cursor-pointer"},Wd=["id"],Gd=["id"],Jd=ue({__name:"LookupInput",props:{id:{},status:{},input:{},metadataType:{},modelValue:{},label:{},labelClass:{},help:{}},emits:["update:modelValue"],setup(r,{emit:e}){let t=Ot().config,n=vt().metadataApi,o=r,u=e,d=c(()=>o.id||o.input.id),v=c(()=>o.label??De(ut(d.value))),l=Ne("ApiState",void 0),p=Ne("client"),f=c(()=>pt.call({responseStatus:o.status??l?.error.value},d.value)),m=A(""),y=A(""),h=c(()=>ye(o.modelValue,d.value)),b=c(()=>et(o.metadataType).find(e=>e.name.toLowerCase()==d.value.toLowerCase())),w=c(()=>Je(b.value?.ref?.model)?.icon||t.value.tableIcon);let k=c(()=>{return(e=b.value?.ref??("lookup"==o.input.type?{model:o.metadataType.name,refId:Jt(o.metadataType)?.name??"id",refLabel:o.metadataType.properties?.find(e=>"String"==e.type&&!e.isPrimaryKey)?.name}:null))?o.input.options?Object.assign({},e,Hl(o.input.options,{input:o.input,$typeFields:et(o.metadataType).map(e=>e.name),...N.config.scopeWhitelist})):e:null;var e}),C;function L(){o.modelValue[d.value]=null,m.value=""}return tt(async()=>{C=Ne("ModalProvider",void 0);let a=o.modelValue,e=(o.modelValue[d.value]||(o.modelValue[d.value]=null),b.value),l=k.value;if(e&&l){m.value="";let t=null==l.selfId?ye(a,e.name):ye(a,l.selfId);var s;null!=(t=rl(t)?ye(a,l.refId):t)&&(s=n.value?.operations.find(e=>e.dataModel?.name==l.model),console.debug("LookupInput queryOp",s),null==s||rl(s=ye(a,e.name))||(m.value=""+s,y.value=e.name,null!=l.refLabel&&((s=et(o.metadataType).filter(e=>e.type==l.model)).length||console.warn(`Could not find ${l.model} Property on `+o.metadataType.name),null!=(s=(s=s.map(e=>ye(a,e.name)).filter(e=>!!e)).length<=1?s[0]:s.find(e=>e[l.refId??"id"]==t))?(s=ye(s,l.refLabel))&&(m.value=""+s,We.setValue(l.model,t,l.refLabel,s)):(s=1==e.attributes?.some(e=>"Computed"==e.name),s=await We.getOrFetchValue(p,n.value,l.model,l.refId,l.refLabel,s,t),m.value=s||l.model+": "+m.value))))}else console.warn(`No RefInfo for property '${d.value}'`)}),(e,t)=>{var l=U("Icon");return a(),i("div",Ed,[s("input",{type:"hidden",name:d.value,value:h.value},null,8,Nd),v.value?(a(),i("div",zd,[s("label",{for:d.value,class:g("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(r.labelClass??""))},T(v.value),11,Ud),h.value?(a(),i("div",qd,[s("span",Qd,T(h.value),1),s("button",{onClick:L,type:"button",title:"clear",class:"mr-1 rounded-md text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:ring-offset-black"},[...t[1]||(t[1]=[s("span",{class:"sr-only"},"Clear",-1),s("svg",{class:"h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)])])])):x("",!0)])):x("",!0),k.value?(a(),i("div",Kd,[s("button",{type:"button",class:"lookup flex relative w-full bg-white dark:bg-black border border-gray-300 dark:border-gray-700 rounded-md shadow-sm pl-3 pr-10 py-2 text-left focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm",onClick:t[0]||(t[0]=e=>{var l;(l=k.value)&&(null==C?console.warn("No ModalProvider required by LookupInput"):C.openModal({name:"ModalLookup",ref:l},e=>{var t,a;console.debug("openModal",m.value," -> ",e,We.setRefValue(l,e),l),e&&(t=ye(e,l.refId),m.value=We.setRefValue(l,e)||t,(a=G(o.modelValue))[d.value]=t,u("update:modelValue",a))}))}),"aria-haspopup":"listbox","aria-expanded":"true","aria-labelledby":"listbox-label"},[s("span",_d,[s("span",Zd,[pe(l,{class:"mr-1 w-5 h-5",image:w.value},null,8,["image"]),s("span",null,T(m.value),1)])]),t[2]||(t[2]=s("span",{class:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none"},[s("svg",{class:"h-5 w-5 text-gray-400 dark:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1))])])):x("",!0),f.value?(a(),i("p",{key:2,class:"mt-2 text-sm text-red-500",id:d.value+"-error"},T(f.value),9,Wd)):r.help?(a(),i("p",{key:3,class:"mt-2 text-sm text-gray-500",id:d.value+"-description"},T(r.help),9,Gd)):x("",!0)])}}}),Xd=ue({__name:"AutoFormFields",props:{modelValue:{},type:{},metaType:{},api:{},formLayout:{},configureField:{},configureFormLayout:{},hideSummary:{type:Boolean},flexClass:{default:"flex flex-1 flex-col justify-between"},divideClass:{default:"divide-y divide-gray-200 px-4 sm:px-6"},spaceClass:{default:"space-y-6 pt-6 pb-5"},fieldsetClass:{default:"grid grid-cols-12 gap-6"}},emits:["update:modelValue"],setup(o,{expose:e,emit:t}){let u=o,l=t;function r(){Pe()?.proxy?.$forceUpdate()}function d(e,t){u.modelValue[e]=t,l("update:modelValue",u.modelValue),r()}e({forceUpdate:r,props:u,updateValue:d});let{metadataApi:n,apiOf:v,typeOf:p,typeOfRef:f,createFormLayout:m}=vt(),y=c(()=>u.type||Ht(u.modelValue)),h=c(()=>u.metaType??p(y.value)),b=c(()=>f(n.value?.operations.find(e=>e.request.name==y.value)?.dataModel)||h.value);function w(){var e,t=h.value;if(!t){if(u.formLayout)return e=u.formLayout.map(e=>{var t={name:e.id,type:Qa(e.type)},t=Object.assign({prop:t},e);return u.configureField&&u.configureField(t),t}),u.configureFormLayout&&u.configureFormLayout(e),e;throw new Error(`MetadataType for ${y.value} not found`)}let a=et(t),l=b.value,s=u.formLayout?Array.from(u.formLayout):m(t),r=[],n=v(t.name);return s.forEach(t=>{var e=a.find(e=>e.name==t.name);t.ignore||(e=l?.properties?.find(e=>e.name.toLowerCase()==t.name?.toLowerCase())??e,e=Object.assign({prop:e,op:n},t),u.configureField&&u.configureField(e),r.push(e))}),u.configureFormLayout&&u.configureFormLayout(r),r}return(l,e)=>{let t=U("ErrorSummary"),r=U("LookupInput"),n=U("DynamicInput");return a(),i(Ve,null,[o.hideSummary?x("",!0):(a(),X(t,{key:0,status:o.api?.error,except:w().filter(e=>"hidden"!=e.type).map(e=>e.id)},null,8,["status","except"])),s("div",{class:g(o.flexClass)},[s("div",{class:g(o.divideClass)},[s("div",{class:g(o.spaceClass)},[s("fieldset",{class:g(o.fieldsetClass)},[(a(!0),i(Ve,null,Se(w(),t=>(a(),i("div",{key:t.id,class:g(["w-full",t.css?.field??("textarea"==t.type?"col-span-12":"col-span-12 xl:col-span-6"+("checkbox"==t.type?" flex items-center":"")),"hidden"==t.type?"hidden":""])},["lookup"===t.type||null!=t.prop?.ref&&"file"!=t.type&&!t.prop.isPrimaryKey?(a(),X(r,{key:0,metadataType:b.value,input:t,modelValue:o.modelValue,"onUpdate:modelValue":e=>{d(t.id,ye(e,t.id))},status:o.api?.error},null,8,["metadataType","input","modelValue","onUpdate:modelValue","status"])):(a(),X(n,{key:1,input:t,modelValue:o.modelValue,"onUpdate:modelValue":e[0]||(e[0]=e=>l.$emit("update:modelValue",e)),api:o.api},null,8,["input","modelValue","api"]))],2))),128))],2)],2)],2)],2)],64)}}}),Yd={key:0},ec={class:"text-red-700"},tc={key:0},lc={key:2},sc=["innerHTML"],nc={class:"flex justify-end"},ac={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},oc={class:"fixed inset-0 overflow-hidden"},ic={class:"flex min-h-0 flex-1 flex-col overflow-auto"},rc={class:"flex-1"},uc={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},dc={class:"flex items-start justify-between space-x-3"},cc={class:"space-y-1"},fc={key:0},vc={key:2},mc=["innerHTML"],gc={class:"flex h-7 items-center"},pc={class:"flex justify-end"},yc=ue({__name:"AutoForm",props:{type:{},modelValue:{},heading:{},subHeading:{},showLoading:{type:Boolean,default:!0},jsconfig:{default:"eccn,edv"},formStyle:{default:"card"},metaType:{},configureField:{},configureFormLayout:{},panelClass:{},bodyClass:{},formClass:{},innerFormClass:{},headerClass:{default:"p-6"},buttonsClass:{},headingClass:{},subHeadingClass:{},submitLabel:{default:"Submit"},allowSubmit:{}},emits:["success","error","done","update:modelValue"],setup(v,{expose:e,emit:t}){let n=v,o=t,p=A(),f=A(1),m=A();function l(){f.value++,D.value=N(),Pe()?.proxy?.$forceUpdate()}ul("ModalProvider",{openModal:function(e,t){y.value=e,r.value=t}});let y=A(),r=A();async function h(e){r.value&&r.value(e),y.value=void 0,r.value=void 0}let u=fl(),d=Gn().getTypeName,{typeOf:b,createDto:w}=vt(),k=A(new Ge),C=c(()=>n.panelClass||Oe.panelClass(n.formStyle)),L=c(()=>n.formClass||"card"==n.formStyle?"shadow sm:rounded-md":Qt.formClass),V=c(()=>n.headingClass||Oe.headingClass(n.formStyle)),S=c(()=>n.subHeadingClass||Oe.subHeadingClass(n.formStyle)),M=c(()=>("string"==typeof n.buttonsClass?n:Oe).buttonsClass),F=c(()=>n.type?d(n.type):n.modelValue?.getTypeName?n.modelValue.getTypeName():null),I=c(()=>n.metaType??b(F.value)),N=()=>n.modelValue||$(),D=A(N()),j=c(()=>u.loading.value),B=c(()=>null!=n.heading?n.heading:I.value?.description||De(F.value));function $(){return"string"==typeof n.type?w(n.type):n.type?new n.type:n.modelValue}async function H(e){var t,a,l,s,r;e&&"FORM"==e.tagName?(t=$(),r=Ee(t?.getMethod,e=>"function"==typeof e?e():null)||"POST",a=null==Ee(t?.createResponse,e=>"function"==typeof e?e():null),l=n.jsconfig,ds.hasRequestBody(r)?(r=new t.constructor,s=new FormData(e),k.value=a?await u.apiFormVoid(r,s,{jsconfig:l}):await u.apiForm(r,s,{jsconfig:l})):(r=new t.constructor(Ia(D.value)),console.debug("AutoForm.submit",r),k.value=a?await u.apiVoid(r,{jsconfig:l}):await u.api(r,{jsconfig:l})),k.value.succeeded?(o("success",k.value.response),z()):o("error",k.value.error)):console.error("Not a valid form",e)}function P(e){o("update:modelValue",e)}function E(){o("done")}e({forceUpdate:l,props:n,setModel:async function(e){Object.assign(D.value,e),l(),await wt(()=>null)},formFields:p,submit:async function(){H(m.value)},close:z,model:D});let R=A(!1),_=A(""),q={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}};function z(){"slideOver"==n.formStyle?R.value=!1:E()}kt(R,()=>{xt(q,_,R.value),R.value||setTimeout(E,700)}),R.value=!0;let G=e=>{"Escape"===e.key&&z()};return tt(()=>window.addEventListener("keydown",G)),jt(()=>window.removeEventListener("keydown",G)),(e,t)=>{let l=U("AutoFormFields"),r=U("FormLoading"),n=U("PrimaryButton"),o=U("CloseButton"),u=U("SecondaryButton"),d=U("ModalLookup");return a(),i("div",null,[I.value?"card"==v.formStyle?(a(),i("div",{key:1,class:g(C.value)},[s("form",{ref_key:"elForm",ref:m,onSubmit:t[0]||(t[0]=He(e=>H(e.target),["prevent"])),autocomplete:"off",class:g(v.innerFormClass)},[s("div",{class:g(v.bodyClass)},[s("div",{class:g(v.headerClass)},[e.$slots.heading?(a(),i("div",tc,[O(e.$slots,"heading")])):(a(),i("h3",{key:1,class:g(V.value)},T(B.value),3)),e.$slots.subheading?(a(),i("div",lc,[O(e.$slots,"subheading")])):v.subHeading?(a(),i("p",{key:3,class:g(S.value)},T(v.subHeading),3)):I.value?.notes?(a(),i("p",{key:4,class:g(["notes",S.value]),innerHTML:I.value?.notes},null,10,sc)):x("",!0)],2),O(e.$slots,"header",{instance:Pe()?.exposed,model:D.value}),t[5]||(t[5]=s("input",{type:"submit",class:"hidden"},null,-1)),(a(),X(l,{ref_key:"formFields",ref:p,key:f.value,type:v.type,modelValue:D.value,"onUpdate:modelValue":P,api:k.value,configureField:v.configureField,configureFormLayout:v.configureFormLayout},null,8,["type","modelValue","api","configureField","configureFormLayout"])),O(e.$slots,"footer",{instance:Pe()?.exposed,model:D.value})],2),O(e.$slots,"buttons",{},()=>[s("div",{class:g(M.value)},[s("div",null,[O(e.$slots,"leftbuttons",{instance:Pe()?.exposed,model:D.value})]),s("div",null,[v.showLoading&&j.value?(a(),X(r,{key:0})):x("",!0)]),s("div",nc,[t[6]||(t[6]=s("div",null,null,-1)),pe(n,{disabled:j.value||!!v.allowSubmit&&!v.allowSubmit(D.value)},{default:we(()=>[he(T(v.submitLabel),1)]),_:1},8,["disabled"]),O(e.$slots,"rightbuttons",{instance:Pe()?.exposed,model:D.value})])],2)])],34)],2)):(a(),i("div",ac,[t[8]||(t[8]=s("div",{class:"fixed inset-0"},null,-1)),s("div",oc,[s("div",{onMousedown:z,class:"absolute inset-0 overflow-hidden"},[s("div",{onMousedown:t[2]||(t[2]=He(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[s("div",{class:g(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",_.value])},[s("form",{ref_key:"elForm",ref:m,class:g(L.value),onSubmit:t[1]||(t[1]=He(e=>H(e.target),["prevent"]))},[s("div",ic,[s("div",rc,[s("div",uc,[s("div",dc,[s("div",cc,[e.$slots.heading?(a(),i("div",fc,[O(e.$slots,"heading")])):(a(),i("h3",{key:1,class:g(V.value)},T(B.value),3)),e.$slots.subheading?(a(),i("div",vc,[O(e.$slots,"subheading")])):v.subHeading?(a(),i("p",{key:3,class:g(S.value)},T(v.subHeading),3)):I.value?.notes?(a(),i("p",{key:4,class:g(["notes",S.value]),innerHTML:I.value?.notes},null,10,mc)):x("",!0)]),s("div",gc,[pe(o,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:z})])])]),O(e.$slots,"header",{instance:Pe()?.exposed,model:D.value}),(a(),X(l,{ref_key:"formFields",ref:p,key:f.value,type:v.type,modelValue:D.value,"onUpdate:modelValue":P,api:k.value,configureField:v.configureField,configureFormLayout:v.configureFormLayout},null,8,["type","modelValue","api","configureField","configureFormLayout"])),O(e.$slots,"footer",{instance:Pe()?.exposed,model:D.value})])]),s("div",{class:g(M.value)},[s("div",null,[O(e.$slots,"leftbuttons",{instance:Pe()?.exposed,model:D.value})]),s("div",null,[v.showLoading&&j.value?(a(),X(r,{key:0})):x("",!0)]),s("div",pc,[pe(u,{onClick:z,disabled:j.value},{default:we(()=>[...t[7]||(t[7]=[he("Cancel",-1)])]),_:1},8,["disabled"]),pe(n,{class:"ml-4",disabled:j.value||!!v.allowSubmit&&!v.allowSubmit(D.value)},{default:we(()=>[he(T(v.submitLabel),1)]),_:1},8,["disabled"]),O(e.$slots,"rightbuttons",{instance:Pe()?.exposed,model:D.value})])],2)],34)],2)],32)],32)])])):(a(),i("div",Yd,[s("p",ec,[t[3]||(t[3]=he("Could not create form for unknown ",-1)),t[4]||(t[4]=s("b",null,"type",-1)),he(" "+T(F.value),1)])])),"ModalLookup"==y.value?.name&&y.value.ref?(a(),X(d,{key:3,"ref-info":y.value.ref,onDone:h,configureField:v.configureField},null,8,["ref-info","configureField"])):x("",!0)])}}}),hc={key:0},bc={class:"text-red-700"},wc={key:0},xc={key:2},kc=["innerHTML"],Cc={class:"flex justify-end"},$c={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},Lc={class:"fixed inset-0 overflow-hidden"},Vc={class:"flex min-h-0 flex-1 flex-col overflow-auto"},Mc={class:"flex-1"},Sc={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},Tc={class:"flex items-start justify-between space-x-3"},Fc={class:"space-y-1"},Ac={key:0},Ic={key:2},Pc=["innerHTML"],Dc={class:"flex h-7 items-center"},Bc={class:"flex justify-end"},jc=ue({__name:"AutoCreateForm",props:{type:{},formStyle:{default:"slideOver"},panelClass:{},formClass:{},headingClass:{},subHeadingClass:{},buttonsClass:{},heading:{},subHeading:{},autosave:{type:Boolean,default:!0},showLoading:{type:Boolean,default:!0},showCancel:{type:Boolean,default:!0},configureField:{},configureFormLayout:{}},emits:["done","save","error"],setup(v,{expose:e,emit:t}){let r=v,n=t,p=A(),f=A(1);function l(){f.value++,p.value?.forceUpdate(),Pe()?.proxy?.$forceUpdate()}function m(e){}ul("ModalProvider",{openModal:function(e,t){y.value=e,o.value=t}});let y=A(),o=A();async function h(e){o.value&&o.value(e),y.value=void 0,o.value=void 0}let{typeOf:u,typeProperties:d,Crud:b,createDto:w,formValues:k}=vt(),C=c(()=>Ht(r.type)),L=c(()=>u(C.value)),V=A("string"==typeof r.type?w(r.type):r.type?new r.type:null),S=(e({forceUpdate:l,props:r,setModel:function(e){Object.assign(V.value,e),l()},formFields:p,model:V}),c(()=>r.panelClass||Oe.panelClass(r.formStyle))),M=c(()=>r.formClass||Oe.formClass(r.formStyle)),F=c(()=>r.headingClass||Oe.headingClass(r.formStyle)),I=c(()=>r.subHeadingClass||Oe.subHeadingClass(r.formStyle)),D=c(()=>r.buttonsClass||Oe.buttonsClass),j=c(()=>b.model(L.value)),B=c(()=>r.heading||u(C.value)?.description||(j.value?"New "+De(j.value):De(C.value))),$=A(new Ge),H=fl(),P=c(()=>H.loading.value);async function E(e){var t,a,l,s=e.target;r.autosave?(a=Ee(V.value?.getMethod,e=>"function"==typeof e?e():null)||"POST",t=null==Ee(V.value?.createResponse,e=>"function"==typeof e?e():null),ds.hasRequestBody(a)?(a=new V.value.constructor,l=new FormData(s),$.value=t?await H.apiFormVoid(a,l,{jsconfig:"eccn"}):await H.apiForm(a,l,{jsconfig:"eccn"})):(a=k(s,d(L.value)),l=new V.value.constructor(a),$.value=t?await H.apiVoid(l,{jsconfig:"eccn"}):await H.api(l,{jsconfig:"eccn"})),$.value.succeeded?(s.reset(),n("save",$.value.response)):n("error",$.value.error)):n("save",new V.value.constructor(k(s,d(L.value))))}function R(){n("done")}N.interceptors.has("AutoCreateForm.new")&&N.interceptors.invoke("AutoCreateForm.new",{props:r,model:V});let _=A(!1),z=A(""),Z={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}};function q(){"slideOver"==r.formStyle?_.value=!1:R()}kt(_,()=>{xt(Z,z,_.value),_.value||setTimeout(R,700)}),_.value=!0;let Q=e=>{"Escape"===e.key&&q()};return tt(()=>window.addEventListener("keydown",Q)),jt(()=>window.removeEventListener("keydown",Q)),(e,t)=>{var l=U("AutoFormFields"),r=U("FormLoading"),n=U("SecondaryButton"),o=U("PrimaryButton"),u=U("CloseButton"),d=U("ModalLookup");return a(),i("div",null,[L.value?"card"==v.formStyle?(a(),i("div",{key:1,class:g(S.value)},[s("form",{onSubmit:He(E,["prevent"])},[s("div",{class:g(M.value)},[s("div",null,[e.$slots.heading?(a(),i("div",wc,[O(e.$slots,"heading")])):(a(),i("h3",{key:1,class:g(F.value)},T(B.value),3)),e.$slots.subheading?(a(),i("div",xc,[O(e.$slots,"subheading")])):v.subHeading?(a(),i("p",{key:3,class:g(I.value)},T(v.subHeading),3)):L.value?.notes?(a(),i("p",{key:4,class:g(["notes",I.value]),innerHTML:L.value?.notes},null,10,kc)):x("",!0)]),O(e.$slots,"header",{formInstance:Pe()?.exposed,model:V.value}),(a(),X(l,{ref_key:"formFields",ref:p,key:f.value,modelValue:V.value,"onUpdate:modelValue":m,api:$.value,configureField:v.configureField,configureFormLayout:v.configureFormLayout},null,8,["modelValue","api","configureField","configureFormLayout"])),O(e.$slots,"footer",{formInstance:Pe()?.exposed,model:V.value})],2),s("div",{class:g(D.value)},[s("div",null,[v.showLoading&&G(P)?(a(),X(r,{key:0})):x("",!0)]),s("div",Cc,[v.showCancel?(a(),X(n,{key:0,onClick:q,disabled:G(P)},{default:we(()=>[...t[3]||(t[3]=[he("Cancel",-1)])]),_:1},8,["disabled"])):x("",!0),pe(o,{type:"submit",class:"ml-4",disabled:G(P)},{default:we(()=>[...t[4]||(t[4]=[he("Save",-1)])]),_:1},8,["disabled"])])],2)],32)],2)):(a(),i("div",$c,[t[7]||(t[7]=s("div",{class:"fixed inset-0"},null,-1)),s("div",Lc,[s("div",{onMousedown:q,class:"absolute inset-0 overflow-hidden"},[s("div",{onMousedown:t[0]||(t[0]=He(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[s("div",{class:g(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",z.value])},[s("form",{class:g(M.value),onSubmit:He(E,["prevent"])},[s("div",Vc,[s("div",Mc,[s("div",Sc,[s("div",Tc,[s("div",Fc,[e.$slots.heading?(a(),i("div",Ac,[O(e.$slots,"heading")])):(a(),i("h3",{key:1,class:g(F.value)},T(B.value),3)),e.$slots.subheading?(a(),i("div",Ic,[O(e.$slots,"subheading")])):v.subHeading?(a(),i("p",{key:3,class:g(I.value)},T(v.subHeading),3)):L.value?.notes?(a(),i("p",{key:4,class:g(["notes",I.value]),innerHTML:L.value?.notes},null,10,Pc)):x("",!0)]),s("div",Dc,[pe(u,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:q})])])]),O(e.$slots,"header",{formInstance:Pe()?.exposed,model:V.value}),(a(),X(l,{ref_key:"formFields",ref:p,key:f.value,modelValue:V.value,"onUpdate:modelValue":m,api:$.value,configureField:v.configureField,configureFormLayout:v.configureFormLayout},null,8,["modelValue","api","configureField","configureFormLayout"])),O(e.$slots,"footer",{formInstance:Pe()?.exposed,model:V.value})])]),s("div",{class:g(D.value)},[s("div",null,[v.showLoading&&G(P)?(a(),X(r,{key:0})):x("",!0)]),s("div",Bc,[v.showCancel?(a(),X(n,{key:0,onClick:q,disabled:G(P)},{default:we(()=>[...t[5]||(t[5]=[he("Cancel",-1)])]),_:1},8,["disabled"])):x("",!0),pe(o,{type:"submit",class:"ml-4",disabled:G(P)},{default:we(()=>[...t[6]||(t[6]=[he("Save",-1)])]),_:1},8,["disabled"])])],2)],34)],2)],32)],32)])])):(a(),i("div",hc,[s("p",bc,[t[1]||(t[1]=he("Could not create form for unknown ",-1)),t[2]||(t[2]=s("b",null,"type",-1)),he(" "+T(C.value),1)])])),"ModalLookup"==y.value?.name&&y.value.ref?(a(),X(d,{key:3,"ref-info":y.value.ref,onDone:h,configureField:v.configureField},null,8,["ref-info","configureField"])):x("",!0)])}}}),Oc={key:0},Hc={class:"text-red-700"},Rc={key:0},Ec={key:2},Nc=["innerHTML"],zc={class:"flex justify-end"},Uc={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},qc={class:"fixed inset-0 overflow-hidden"},Qc={class:"flex min-h-0 flex-1 flex-col overflow-auto"},Kc={class:"flex-1"},_c={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},Zc={class:"flex items-start justify-between space-x-3"},Wc={class:"space-y-1"},Gc={key:0},Jc={key:2},Xc=["innerHTML"],Yc={class:"flex h-7 items-center"},e0={class:"flex justify-end"},t0=ue({__name:"AutoEditForm",props:{modelValue:{},deleteType:{},type:{},formStyle:{default:"slideOver"},panelClass:{},formClass:{},headingClass:{},subHeadingClass:{},buttonsClass:{},heading:{},subHeading:{},autosave:{type:Boolean,default:!0},showLoading:{type:Boolean,default:!0},showCancel:{type:Boolean},configureField:{},configureFormLayout:{}},emits:["done","save","delete","error"],setup(v,{expose:e,emit:Z}){let r=v,n=Z,p=A(),f=A(1);function m(e){}ul("ModalProvider",{openModal:function(e,t){y.value=e,l.value=t}});let y=A(),l=A();async function W(e){l.value&&l.value(e),y.value=void 0,l.value=void 0}let{typeOf:t,apiOf:K,typeProperties:o,createFormLayout:J,getPrimaryKey:Y,Crud:h,createDto:u,formValues:b}=vt(),w=c(()=>Ht(r.type)),k=c(()=>t(w.value)),d=()=>"string"==typeof r.type?u(r.type,sl(r.modelValue)):r.type?new r.type(sl(r.modelValue)):null,C=A(d()),ee=(e({forceUpdate:function(){f.value++,C.value=d(),Pe()?.proxy?.$forceUpdate()},props:r,setModel:function(e){Object.assign(C.value,e)},formFields:p,model:C}),c(()=>r.panelClass||Oe.panelClass(r.formStyle))),L=c(()=>r.formClass||Oe.formClass(r.formStyle)),V=c(()=>r.headingClass||Oe.headingClass(r.formStyle)),S=c(()=>r.subHeadingClass||Oe.subHeadingClass(r.formStyle)),M=c(()=>r.buttonsClass||Oe.buttonsClass),F=c(()=>h.model(k.value)),I=c(()=>r.heading||t(w.value)?.description||(F.value?"Update "+De(F.value):De(w.value))),D=A(new Ge),j=Object.assign({},sl(r.modelValue)),B=(N.interceptors.has("AutoEditForm.new")&&N.interceptors.invoke("AutoEditForm.new",{props:r,model:C,origModel:j}),fl()),$=c(()=>B.loading.value),H=()=>Ee(t(h.model(k.value)),e=>Y(e));function te(e){var{op:t,prop:a}=e;t&&(h.isPatch(t)||h.isUpdate(t))&&(e.disabled=a?.isPrimaryKey),r.configureField&&r.configureField(e)}async function P(e){var l=e.target;if(r.autosave){let e=Ee(C.value?.getMethod,e=>"function"==typeof e?e():null)||"POST",a=null==Ee(C.value?.createResponse,e=>"function"==typeof e?e():null),d=H();if(ds.hasRequestBody(e)){let e=new C.value.constructor,t=ye(r.modelValue,d.name),i=new FormData(l),u=(d&&!Array.from(i.keys()).some(e=>e.toLowerCase()==d.name.toLowerCase())&&i.append(d.name,t),[]);var s=w.value&&K(w.value);if(s&&h.isPatch(s)){let n=J(k.value),o={};if(d&&(o[d.name]=t),n.forEach(a=>{var l=a.id,s=ye(j,l);if(!d||d.name.toLowerCase()!==l.toLowerCase()){var r=i.get(l);N.interceptors.has("AutoEditForm.save.formLayout")&&N.interceptors.invoke("AutoEditForm.save.formLayout",{origValue:s,formLayout:n,input:a,newValue:r});let e=null!=r,t="checkbox"===a.type?e!=!!s:"file"===a.type?e:r!=s;(t=r||s?t:!1)&&(r?o[l]=r:"file"!==a.type&&u.push(l))}}),N.interceptors.has("AutoEditForm.save")&&N.interceptors.invoke("AutoEditForm.save",{origModel:j,formLayout:n,dirtyValues:o}),Array.from(i.keys()).filter(e=>!o[e]).forEach(e=>i.delete(e)),0==Array.from(i.keys()).filter(e=>e.toLowerCase()!=d.name.toLowerCase()).length&&0==u.length)return void q()}s=0<u.length?{jsconfig:"eccn",reset:u}:{jsconfig:"eccn"};D.value=a?await B.apiFormVoid(e,i,s):await B.apiForm(e,i,s)}else{s=b(l,o(k.value)),s=(d&&!ye(s,d.name)&&(s[d.name]=ye(r.modelValue,d.name)),new C.value.constructor(s));D.value=a?await B.apiVoid(s,{jsconfig:"eccn"}):await B.api(s,{jsconfig:"eccn"})}D.value.succeeded?(l.reset(),n("save",D.value.response)):n("error",D.value.error)}else n("save",new C.value.constructor(b(l,o(k.value))))}async function E(e){var t=H(),a=t?ye(r.modelValue,t.name):null;a?(t={[t.name]:a},a="string"==typeof r.deleteType?u(r.deleteType,t):r.deleteType?new r.deleteType(t):null,null==Ee(a.createResponse,e=>"function"==typeof e?e():null)?D.value=await B.apiVoid(a):D.value=await B.api(a),D.value.succeeded?n("delete",D.value.response):n("error",D.value.error)):console.error(`Could not find Primary Key for Type ${w.value} (${F.value})`)}function R(){n("done")}let _=A(!1),z=A(""),ae={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}};function q(){"slideOver"==r.formStyle?_.value=!1:R()}kt(_,()=>{xt(ae,z,_.value),_.value||setTimeout(R,700)}),_.value=!0;let Q=e=>{"Escape"===e.key&&q()};return tt(()=>window.addEventListener("keydown",Q)),jt(()=>window.removeEventListener("keydown",Q)),(e,t)=>{var l=U("AutoFormFields"),r=U("ConfirmDelete"),n=U("FormLoading"),o=U("SecondaryButton"),u=U("PrimaryButton"),d=U("CloseButton"),c=U("ModalLookup");return a(),i("div",null,[k.value?"card"==v.formStyle?(a(),i("div",{key:1,class:g(ee.value)},[s("form",{onSubmit:He(P,["prevent"])},[s("div",{class:g(L.value)},[s("div",null,[e.$slots.heading?(a(),i("div",Rc,[O(e.$slots,"heading")])):(a(),i("h3",{key:1,class:g(V.value)},T(I.value),3)),e.$slots.subheading?(a(),i("div",Ec,[O(e.$slots,"subheading")])):v.subHeading?(a(),i("p",{key:3,class:g(S.value)},T(v.subHeading),3)):k.value?.notes?(a(),i("p",{key:4,class:g(["notes",S.value]),innerHTML:k.value?.notes},null,10,Nc)):x("",!0)]),O(e.$slots,"header",{formInstance:Pe()?.exposed,model:C.value}),(a(),X(l,{ref_key:"formFields",ref:p,key:f.value,modelValue:C.value,"onUpdate:modelValue":m,api:D.value,configureField:v.configureField,configureFormLayout:v.configureFormLayout},null,8,["modelValue","api","configureField","configureFormLayout"])),O(e.$slots,"footer",{formInstance:Pe()?.exposed,model:C.value})],2),s("div",{class:g(M.value)},[s("div",null,[v.deleteType?(a(),X(r,{key:0,onDelete:E})):x("",!0)]),s("div",null,[v.showLoading&&G($)?(a(),X(n,{key:0})):x("",!0)]),s("div",zc,[v.showCancel?(a(),X(o,{key:0,onClick:q,disabled:G($)},{default:we(()=>[...t[3]||(t[3]=[he("Cancel",-1)])]),_:1},8,["disabled"])):x("",!0),pe(u,{type:"submit",class:"ml-4",disabled:G($)},{default:we(()=>[...t[4]||(t[4]=[he("Save",-1)])]),_:1},8,["disabled"])])],2)],32)],2)):(a(),i("div",Uc,[t[7]||(t[7]=s("div",{class:"fixed inset-0"},null,-1)),s("div",qc,[s("div",{onMousedown:q,class:"absolute inset-0 overflow-hidden"},[s("div",{onMousedown:t[0]||(t[0]=He(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[s("div",{class:g(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",z.value])},[s("form",{class:g(L.value),onSubmit:He(P,["prevent"])},[s("div",Qc,[s("div",Kc,[s("div",_c,[s("div",Zc,[s("div",Wc,[e.$slots.heading?(a(),i("div",Gc,[O(e.$slots,"heading")])):(a(),i("h3",{key:1,class:g(V.value)},T(I.value),3)),e.$slots.subheading?(a(),i("div",Jc,[O(e.$slots,"subheading")])):v.subHeading?(a(),i("p",{key:3,class:g(S.value)},T(v.subHeading),3)):k.value?.notes?(a(),i("p",{key:4,class:g(["notes",S.value]),innerHTML:k.value?.notes},null,10,Xc)):x("",!0)]),s("div",Yc,[pe(d,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:q})])])]),O(e.$slots,"header",{formInstance:Pe()?.exposed,model:C.value}),(a(),X(l,{ref_key:"formFields",ref:p,key:f.value,modelValue:C.value,"onUpdate:modelValue":m,api:D.value,configureField:te,configureFormLayout:v.configureFormLayout},null,8,["modelValue","api","configureFormLayout"])),O(e.$slots,"footer",{formInstance:Pe()?.exposed,model:C.value})])]),s("div",{class:g(M.value)},[s("div",null,[v.deleteType?(a(),X(r,{key:0,onDelete:E})):x("",!0)]),s("div",null,[v.showLoading&&G($)?(a(),X(n,{key:0})):x("",!0)]),s("div",e0,[v.showCancel?(a(),X(o,{key:0,onClick:q,disabled:G($)},{default:we(()=>[...t[5]||(t[5]=[he("Cancel",-1)])]),_:1},8,["disabled"])):x("",!0),pe(u,{type:"submit",class:"ml-4",disabled:G($)},{default:we(()=>[...t[6]||(t[6]=[he("Save",-1)])]),_:1},8,["disabled"])])],2)],34)],2)],32)],32)])])):(a(),i("div",Oc,[s("p",Hc,[t[1]||(t[1]=he("Could not create form for unknown ",-1)),t[2]||(t[2]=s("b",null,"type",-1)),he(" "+T(w.value),1)])])),"ModalLookup"==y.value?.name&&y.value.ref?(a(),X(c,{key:3,"ref-info":y.value.ref,onDone:W,configureField:v.configureField},null,8,["ref-info","configureField"])):x("",!0)])}}}),l0={key:0},s0={class:"text-red-700"},n0={key:0},a0={key:2},o0=["innerHTML"],i0={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},r0={class:"fixed inset-0 overflow-hidden"},u0={class:"flex min-h-0 flex-1 flex-col overflow-auto"},d0={class:"flex-1"},c0={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},f0={class:"flex items-start justify-between space-x-3"},v0={class:"space-y-1"},m0={key:0},g0={key:2},p0=["innerHTML"],y0={class:"flex h-7 items-center"},h0=ue({__name:"AutoViewForm",props:{model:{},apis:{},typeName:{},done:{},formStyle:{default:"slideOver"},panelClass:{},formClass:{},headingClass:{},subHeadingClass:{},heading:{},subHeading:{},showLoading:{type:Boolean},deleteType:{}},emits:["done","save","delete","error"],setup(u,{emit:e}){let l=u,r=e,{typeOf:t,getPrimaryKey:n,createDto:o}=vt(),d=c(()=>l.typeName??l.apis.dataModel.name),v=c(()=>t(d.value)),p=c(()=>l.panelClass||Oe.panelClass(l.formStyle)),f=c(()=>l.formClass||Oe.formClass(l.formStyle)),m=c(()=>l.headingClass||Oe.headingClass(l.formStyle)),y=c(()=>l.subHeadingClass||Oe.subHeadingClass(l.formStyle)),h=c(()=>l.heading||t(d.value)?.description||(l.model?.id?De(d.value)+" "+l.model.id:"View "+De(d.value))),b=A(new Ge),w=(Object.assign({},sl(l.model)),N.interceptors.has("AutoViewForm.new")&&N.interceptors.invoke("AutoViewForm.new",{props:l}),fl()),k=c(()=>w.loading.value),C=c(()=>v.value);async function L(e){var t=Ee(v.value,e=>n(e)),a=t?ye(l.model,t.name):null;a?(t={[t.name]:a},a="string"==typeof l.deleteType?o(l.deleteType,t):l.deleteType?new l.deleteType(t):null,null==Ee(a.createResponse,e=>"function"==typeof e?e():null)?b.value=await w.apiVoid(a):b.value=await w.api(a),b.value.succeeded?r("delete",b.value.response):r("error",b.value.error)):console.error(`Could not find Primary Key for Type ${d.value} (${C.value})`)}function V(){l.done&&l.done()}let S=A(!1),M=A(""),F={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}};function I(){"slideOver"==l.formStyle?S.value=!1:V()}kt(S,()=>{xt(F,M,S.value),S.value||setTimeout(V,700)}),S.value=!0;let D=e=>{"Escape"===e.key&&I()};return tt(()=>window.addEventListener("keydown",D)),jt(()=>window.removeEventListener("keydown",D)),(e,t)=>{var l=U("MarkupModel"),r=U("CloseButton"),n=U("ConfirmDelete"),o=U("FormLoading");return a(),i("div",null,[d.value?"card"==u.formStyle?(a(),i("div",{key:1,class:g(p.value)},[s("div",{class:g(f.value)},[s("div",null,[e.$slots.heading?(a(),i("div",n0,[O(e.$slots,"heading")])):(a(),i("h3",{key:1,class:g(m.value)},T(h.value),3)),e.$slots.subheading?(a(),i("div",a0,[O(e.$slots,"subheading")])):u.subHeading?(a(),i("p",{key:3,class:g(y.value)},T(u.subHeading),3)):v.value?.notes?(a(),i("p",{key:4,class:g(["notes",y.value]),innerHTML:v.value?.notes},null,10,o0)):x("",!0)]),pe(l,{value:u.model},null,8,["value"])],2)],2)):(a(),i("div",i0,[t[4]||(t[4]=s("div",{class:"fixed inset-0"},null,-1)),s("div",r0,[s("div",{onMousedown:I,class:"absolute inset-0 overflow-hidden"},[s("div",{onMousedown:t[0]||(t[0]=He(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[s("div",{class:g(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",M.value])},[s("div",{class:g(f.value)},[s("div",u0,[s("div",d0,[s("div",c0,[s("div",f0,[s("div",v0,[e.$slots.heading?(a(),i("div",m0,[O(e.$slots,"heading")])):(a(),i("h3",{key:1,class:g(m.value)},T(h.value),3)),e.$slots.subheading?(a(),i("div",g0,[O(e.$slots,"subheading")])):u.subHeading?(a(),i("p",{key:3,class:g(y.value)},T(u.subHeading),3)):v.value?.notes?(a(),i("p",{key:4,class:g(["notes",y.value]),innerHTML:v.value?.notes},null,10,p0)):x("",!0)]),s("div",y0,[pe(r,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:I})])])]),s("div",null,[pe(l,{value:u.model,tableClass:"w-full border-separate border-spacing-y-1",basicTrClass:"group",basicThClass:"py-1 px-4 text-left text-sm font-medium text-gray-700 dark:text-gray-300",basicTdClass:"py-1 px-4 text-sm text-gray-900",complexTitleTrClass:"group",complexTitleTdClass:"py-1 px-4 font-semibold bg-indigo-600 dark:bg-indigo-700 text-white",complexBodyTrClass:"group",complexBodyTdClass:"py-1 px-4 bg-white dark:bg-gray-900"},null,8,["value"])])])]),s("div",{class:g(G(Oe).buttonsClass)},[s("div",null,[u.deleteType?(a(),X(n,{key:0,onDelete:L})):x("",!0)]),s("div",null,[u.showLoading&&G(k)?(a(),X(o,{key:0})):x("",!0)]),t[3]||(t[3]=s("div",{class:"flex justify-end"},null,-1))],2)],2)],2)],32)],32)])])):(a(),i("div",l0,[s("p",s0,[t[1]||(t[1]=he("Could not create view for unknown ",-1)),t[2]||(t[2]=s("b",null,"type",-1)),he(" "+T(d.value),1)])]))])}}}),b0=ue({__name:"ConfirmDelete",emits:["delete"],setup(e,{emit:t}){let l=A(!1),r=t,n=()=>{l.value&&r("delete")},o=c(()=>["select-none inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white",l.value?"cursor-pointer bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500":"bg-red-400"]);return(e,t)=>(a(),i(Ve,null,[Pt(s("input",{id:"confirmDelete",type:"checkbox",class:"focus:ring-indigo-500 h-4 w-4 text-indigo-600 rounded border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:ring-offset-black","onUpdate:modelValue":t[0]||(t[0]=e=>en(l)?l.value=e:l=e)},null,512),[[rs,G(l)]]),t[2]||(t[2]=s("label",{for:"confirmDelete",class:"ml-2 mr-2 select-none"},"confirm",-1)),s("span",Ce({onClick:He(n,["prevent"]),class:o.value},e.$attrs),[O(e.$slots,"default",{},()=>[t[1]||(t[1]=he("Delete",-1))])],16)],64))}}),w0={class:"flex",title:"loading..."},x0={key:0,xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"24px",height:"30px",viewBox:"0 0 24 30"},k0={class:"ml-2 mt-1 text-gray-400"},C0=ue({__name:"FormLoading",props:{icon:{type:Boolean,default:!0},text:{default:"loading..."}},setup(l){return Ne("ApiState",void 0),(e,t)=>(a(),i("div",w0,[l.icon?(a(),i("svg",x0,[...t[0]||(t[0]=[Sl('<rect x="0" y="10" width="4" height="10" fill="#333" opacity="0.2"><animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0s" dur="0.6s" repeatCount="indefinite"></animate></rect><rect x="8" y="10" width="4" height="10" fill="#333" opacity="0.2"><animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0.15s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0.15s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0.15s" dur="0.6s" repeatCount="indefinite"></animate></rect><rect x="16" y="10" width="4" height="10" fill="#333" opacity="0.2"><animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0.3s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0.3s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0.3s" dur="0.6s" repeatCount="indefinite"></animate></rect>',3)])])):x("",!0),s("span",k0,T(l.text),1)]))}}),$0=["onClick"],L0={key:3,class:"flex justify-between items-center"},V0={class:"mr-1 select-none"},M0=["onClick"],S0=ue({inheritAttrs:!1,__name:"DataGrid",props:{items:{default:()=>[]},id:{default:"DataGrid"},ctx:{},type:{},tableStyle:{default:"stripedRows"},selectedColumns:{},gridClass:{},grid2Class:{},grid3Class:{},grid4Class:{},tableClass:{},theadClass:{},tbodyClass:{},theadRowClass:{},theadCellClass:{},isSelected:{},headerTitle:{},headerTitles:{},visibleFrom:{},rowClass:{},rowStyle:{}},emits:["headerSelected","rowSelected"],setup(t,{emit:e}){let u=t,d=e,l=A(),v=A(null),p=Tl(),r=Object.keys(p),n=r.map(e=>e.toLowerCase()),o=e=>n.includes(e.toLowerCase()),f=t=>r.find(e=>e.toLowerCase()==t.toLowerCase()+"-header"),m=t=>r.find(e=>e.toLowerCase()==t.toLowerCase()),y=c(()=>Jl(u.items).filter(e=>o(e)||o(e+"-header"))),h=c(()=>u.ctx?.dataModelName||Ht(u.type)),b=c(()=>u.ctx?.dataModel||Je(h.value)),w=c(()=>u.ctx?.dataModelProps||et(b.value));function k(e){var t=u.headerTitles&&ye(u.headerTitles,e)||e;return u.headerTitle?u.headerTitle(t):rn(t)}function C(e){let t=e.toLowerCase();return w.value.find(e=>e.name.toLowerCase()==t)}let L={xs:"xs:table-cell",sm:"sm:table-cell",md:"md:table-cell",lg:"lg:table-cell",xl:"xl:table-cell","2xl":"2xl:table-cell",never:""};function V(e){var t=u.visibleFrom&&ye(u.visibleFrom,e);return t&&Ee(L[t],e=>"hidden "+e)}let S=c(()=>u.gridClass??ge.getGridClass(u.tableStyle)),M=c(()=>u.grid2Class??ge.getGrid2Class(u.tableStyle)),F=c(()=>u.grid3Class??ge.getGrid3Class(u.tableStyle)),I=c(()=>u.grid4Class??ge.getGrid4Class(u.tableStyle)),N=c(()=>u.tableClass??ge.getTableClass(u.tableStyle)),D=c(()=>u.tbodyClass??ge.getTbodyClass(u.tbodyClass)),j=c(()=>u.theadClass??ge.getTheadClass(u.tableStyle)),B=c(()=>u.theadRowClass??ge.getTheadRowClass(u.tableStyle)),$=c(()=>u.theadCellClass??ge.getTheadCellClass(u.tableStyle));let H=c(()=>{let e=("string"==typeof u.selectedColumns?u.selectedColumns.split(","):u.selectedColumns)||(0<y.value.length?y.value:Jl(u.items)),t=w.value.reduce((e,t)=>(e[t.name.toLowerCase()]=t.format,e),{});return e.filter(e=>"hidden"!=t[e.toLowerCase()]?.method)});return(r,e)=>{let n=U("CellFormat"),o=U("PreviewFormat");return t.items.length?(a(),i("div",{key:0,ref_key:"refResults",ref:l,class:g(S.value)},[s("div",{class:g(M.value)},[s("div",{class:g(F.value)},[s("div",{class:g(I.value)},[s("table",{class:g(N.value)},[s("thead",{class:g(j.value)},[s("tr",{class:g(B.value)},[(a(!0),i(Ve,null,Se(H.value,l=>{return a(),i("td",{class:g([V(l),$.value,(e=l,v.value===e?"text-gray-900 dark:text-gray-50":"text-gray-500 dark:text-gray-400")])},[s("div",{onClick:e=>{var t;e=e,t=l,d("headerSelected",t,e)}},[G(p)[l+"-header"]?O(r.$slots,l+"-header",{key:0,column:l}):f(l)?O(r.$slots,f(l),{key:1,column:l}):G(p).header?O(r.$slots,"header",{key:2,column:l,label:k(l)}):(a(),i("div",L0,[s("span",V0,T(k(l)),1)]))],8,$0)],2);var e}),256))],2)],2),s("tbody",{class:g(D.value)},[(a(!0),i(Ve,null,Se(t.items,(l,e)=>{return a(),i("tr",{class:g((t=l,s=e,u.rowClass?u.rowClass(t,s):ge.getTableRowClass(u.tableStyle,s,!(!u.isSelected||!u.isSelected(t)),null!=u.isSelected))),style:is((s=l,t=e,u.rowStyle?u.rowStyle(s,t):void 0)),onClick:e=>{var t;e=e,t=l,d("rowSelected",t,e)}},[(a(!0),i(Ve,null,Se(H.value,e=>{return a(),i("td",{class:g([V(e),G(ge).tableCellClass])},[G(p)[e]?O(r.$slots,e,Ce({key:0,ref_for:!0},l)):m(e)?O(r.$slots,m(e),Ce({key:1,ref_for:!0},l)):C(e)?(a(),X(n,{key:2,type:b.value,propType:C(e),modelValue:l},null,8,["type","propType","modelValue"])):(a(),X(o,{key:3,value:G(ye)(l,e),format:(t=C(e))?.format?t.format:"TimeSpan"==t?.type||"TimeOnly"==t?.type?{method:"time"}:null,modelValue:l},null,8,["value","format","modelValue"]))],2);var t}),256))],14,M0);var t,s}),256))],2)],2)],2)],2)],2)],2)):x("",!0)}}}),T0=ue({props:{type:Object,propType:Object,modelValue:Object},setup(u,{attrs:d}){let c=vt().typeOf;return()=>{let e=(n=u.propType)?.format?n.format:"TimeSpan"==n?.type||"TimeOnly"==n?.type?{method:"time"}:null,t=ye(u.modelValue,u.propType.name),a=Object.assign({},u,d),l=St("span",{innerHTML:il(t,e,a)}),s=rl(t)&&Array.isArray(t)?St("span",{},[St("span",{class:"mr-2"},""+t.length),l]):l,r=u.propType?.ref;var n,o,i;return r&&(o=et(u.type).find(e=>e.type===r.model))&&(o=(o=ye(u.modelValue,o.name))&&r.refLabel&&ye(o,r.refLabel))?(i=(i=c(r.model)?.icon)?St(Yn,{image:i,class:"w-5 h-5 mr-1"}):null,St("span",{class:"flex",title:r.model+" "+t},[i,o])):s}}}),F0={key:0},A0={key:0,class:"mr-2"},I0=["innerHTML"],P0=["innerHTML"],D0={inheritAttrs:!1},B0=ue({...D0,__name:"PreviewFormat",props:{value:{},format:{},includeIcon:{type:Boolean,default:!0},includeCount:{type:Boolean,default:!0},maxFieldLength:{default:150},maxNestedFields:{default:2},maxNestedFieldLength:{default:30}},setup(l){let e=l,r=c(()=>Array.isArray(e.value));return(e,t)=>G(rl)(l.value)?(a(),i("span",F0,[l.includeCount&&r.value?(a(),i("span",A0,T(l.value.length),1)):x("",!0),s("span",{innerHTML:G(il)(l.value,l.format,e.$attrs)},null,8,I0)])):(a(),i("span",{key:1,innerHTML:G(il)(l.value,l.format,e.$attrs)},null,8,P0))}}),j0=["innerHTML"],O0={key:0},H0={key:2},R0=ue({__name:"HtmlFormat",props:{value:{},depth:{default:0},fieldAttrs:{},classes:{type:Function,default:(e,t,a,l,s)=>l}},setup(n){let t=n,o=c(()=>Bt(t.value)),u=c(()=>Array.isArray(t.value)),d=e=>rn(e),v=e=>t.fieldAttrs?t.fieldAttrs(e):null,p=c(()=>Jl(t.value));return(e,t)=>{let l=U("HtmlFormat",!0);return a(),i("div",{class:g(0==n.depth?"prose html-format":"")},[o.value?(a(),i("div",{key:0,innerHTML:G(il)(n.value)},null,8,j0)):u.value?(a(),i("div",{key:1,class:g(n.classes("array","div",n.depth,G(ge).gridClass))},[G(Bt)(n.value[0])?(a(),i("div",O0,"[ "+T(n.value.join(", "))+" ]",1)):(a(),i("div",{key:1,class:g(n.classes("array","div",n.depth,G(ge).grid2Class))},[s("div",{class:g(n.classes("array","div",n.depth,G(ge).grid3Class))},[s("div",{class:g(n.classes("array","div",n.depth,G(ge).grid4Class))},[s("table",{class:g(n.classes("object","table",n.depth,G(ge).tableClass))},[s("thead",{class:g(n.classes("array","thead",n.depth,G(ge).theadClass))},[s("tr",null,[(a(!0),i(Ve,null,Se(p.value,e=>(a(),i("th",{class:g(n.classes("array","th",n.depth,G(ge).theadCellClass+" whitespace-nowrap"))},[t[0]||(t[0]=s("b",null,null,-1)),he(T(d(e)),1)],2))),256))])],2),s("tbody",null,[(a(!0),i(Ve,null,Se(n.value,(t,e)=>(a(),i("tr",{class:g(n.classes("array","tr",n.depth,e%2==0?"bg-white":"bg-gray-50",e))},[(a(!0),i(Ve,null,Se(p.value,e=>(a(),i("td",{class:g(n.classes("array","td",n.depth,G(ge).tableCellClass))},[pe(l,Ce({value:t[e],"field-attrs":n.fieldAttrs,depth:n.depth+1,classes:n.classes},{ref_for:!0},v(e)),null,16,["value","field-attrs","depth","classes"])],2))),256))],2))),256))])],2)],2)],2)],2))],2)):(a(),i("div",H0,[s("table",{class:g(n.classes("object","table",n.depth,"table-object"))},[(a(!0),i(Ve,null,Se((r=n.value)?Object.keys(r).map(e=>({key:d(e),val:r[e]})):[],e=>(a(),i("tr",{class:g(n.classes("object","tr",n.depth,""))},[s("th",{class:g(n.classes("object","th",n.depth,"align-top py-2 px-4 text-left text-sm font-medium tracking-wider whitespace-nowrap"))},T(e.key),3),s("td",{class:g(n.classes("object","td",n.depth,"align-top py-2 px-4 text-sm"))},[pe(l,Ce({value:e.val,"field-attrs":n.fieldAttrs,depth:n.depth+1,classes:n.classes},{ref_for:!0},v(e.key)),null,16,["value","field-attrs","depth","classes"])],2)],2))),256))],2)]))],2);var r}}}),E0=["href"],N0=["href","title"],z0=ue({__name:"MarkupFormat",props:{value:{},imageClass:{default:"w-8 h-8"}},setup(r){var e=r,t=Ha().getMimeType,l=e.value;let n=typeof e.value;e="string"===n&&l.length?t(l):null;return"string"===n&&l.length&&(((t=l.startsWith("https://")||l.startsWith("http://"))||"/"===l[0])&&e?.startsWith("image/")?n="image":t&&(n="link")),(e,t)=>{var l=U("Icon"),s=U("HtmlFormat");return"link"==G(n)?(a(),i("a",{key:0,href:r.value,class:"text-indigo-600"},T(r.value),9,E0)):"image"==G(n)?(a(),i("a",{key:1,href:r.value,title:r.value,class:"inline-block"},[pe(l,{src:r.value,class:g(r.imageClass)},null,8,["src","class"])],8,N0)):(a(),X(s,{key:2,value:r.value},null,8,["value"]))}}}),U0=ue({__name:"MarkupModel",props:{value:{},imageClass:{},tableClass:{},basicTrClass:{},basicThClass:{},basicTdClass:{},complexTitleTrClass:{},complexTitleTdClass:{},complexBodyTrClass:{},complexBodyTdClass:{}},setup(e){let r=e,t=Object.keys(r.value),n={},o={};return t.forEach(e=>{var t=r.value[e],a=typeof t;null==t||"function"==a||"symbol"==a?n[e]=`(${null==t?"null":"t"})`:"object"==a?o[e]=t:n[e]=t}),(e,t)=>{let l=U("MarkupFormat");return a(),i("table",{class:g(r.tableClass??"my-2 w-full")},[s("tbody",null,[(a(),i(Ve,null,Se(n,(e,t)=>s("tr",{class:g(r.basicTrClass??"leading-7")},[s("th",{class:g(r.basicThClass??"px-2 text-left align-top")},T(G(De)(t)),3),s("td",{class:g(r.basicTdClass??"align-top")},[pe(l,{value:e},null,8,["value"])],2)],2)),64)),(a(),i(Ve,null,Se(o,(e,t)=>(a(),i(Ve,null,[s("tr",{class:g(r.complexTitleTrClass??"my-2 leading-7")},[s("th",{colspan:"2",class:g(r.complexTitleTdClass??"px-2 bg-indigo-700 text-white")},T(G(De)(t)),3)],2),s("tr",{class:g(r.complexBodyTrClass??"leading-7")},[s("td",{colspan:"2",class:g(r.complexBodyTdClass??"px-2 align-top")},[pe(l,{value:e},null,8,["value"])],2)],2)],64))),64))])],2)}}}),q0={class:"absolute top-0 right-0 pt-4 pr-4"},Q0=["title"],K0=ue({__name:"CloseButton",props:{buttonClass:{default:"bg-white dark:bg-black"},title:{default:"Close"}},emits:["close"],setup(l,{}){return(t,e)=>(a(),i("div",q0,[s("button",{type:"button",onClick:e[0]||(e[0]=e=>t.$emit("close")),title:l.title,class:g([l.buttonClass,"cursor-pointer rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black"])},[...e[1]||(e[1]=[s("span",{class:"sr-only"},"Close",-1),s("svg",{class:"h-6 w-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],10,Q0)]))}}),_0=["id","aria-labelledby"],Z0={class:"fixed inset-0 overflow-hidden"},W0={class:"flex h-full flex-col bg-white dark:bg-black shadow-xl"},G0={class:"flex min-h-0 flex-1 flex-col overflow-auto"},J0={class:"flex-1"},X0={class:"relative bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},Y0={class:"flex items-start justify-between space-x-3"},ef={class:"space-y-1"},tf={key:0},lf=["id"],sf={key:2,class:"text-sm text-gray-500"},nf={class:"flex h-7 items-center"},af={key:0,class:"flex-shrink-0 border-t border-gray-200 dark:border-gray-700 px-4 py-5 sm:px-6"},of=ue({__name:"SlideOver",props:{id:{default:"SlideOver"},title:{},contentClass:{default:"relative mt-6 flex-1 px-4 sm:px-6"}},emits:["done"],setup(r,{emit:e}){let t=e,l=A(!1),n=A(""),o={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}},u=(kt(l,()=>{xt(o,n,l.value),l.value||setTimeout(()=>t("done"),700)}),l.value=!0,()=>l.value=!1),d=e=>{"Escape"===e.key&&u()};return tt(()=>window.addEventListener("keydown",d)),jt(()=>window.removeEventListener("keydown",d)),(e,t)=>{var l=U("CloseButton");return a(),i("div",{id:r.id,class:"relative z-10","aria-labelledby":r.id+"-title",role:"dialog","aria-modal":"true"},[t[1]||(t[1]=s("div",{class:"fixed inset-0"},null,-1)),s("div",Z0,[s("div",{onMousedown:u,class:"absolute inset-0 overflow-hidden"},[s("div",{onMousedown:t[0]||(t[0]=He(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[s("div",{class:g(["panel pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",n.value])},[s("div",W0,[s("div",G0,[s("div",J0,[s("div",X0,[s("div",Y0,[s("div",ef,[e.$slots.title?(a(),i("div",tf,[O(e.$slots,"title")])):x("",!0),r.title?(a(),i("h2",{key:1,class:"text-lg font-medium text-gray-900 dark:text-gray-50",id:r.id+"-title"},T(r.title),9,lf)):x("",!0),e.$slots.subtitle?(a(),i("p",sf,[O(e.$slots,"subtitle")])):x("",!0)]),s("div",nf,[pe(l,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:u})])])]),s("div",{class:g(r.contentClass)},[O(e.$slots,"default")],2)])]),e.$slots.footer?(a(),i("div",af,[O(e.$slots,"footer")])):x("",!0)])],2)],32)],32)])],8,_0)}}}),rf=["id","data-transition-for","aria-labelledby"],uf={class:"fixed inset-0 z-10 overflow-y-auto"},df={class:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0"},cf={key:1,class:"hidden sm:block absolute top-0 right-0 pt-4 pr-4 z-10"},ff=ue({__name:"ModalDialog",props:{id:{default:"ModalDialog"},modalClass:{default:os.modalClass},sizeClass:{default:os.sizeClass},closeButtonClass:{default:"bg-white dark:bg-black cursor-pointer rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black"},configureField:{}},emits:["done"],setup(r,{emit:e}){let n=Tl(),t=e,l=A(!1),o=A(""),u={entering:{cls:"ease-out duration-300",from:"opacity-0",to:"opacity-100"},leaving:{cls:"ease-in duration-200",from:"opacity-100",to:"opacity-0"}},d=A(""),c={entering:{cls:"ease-out duration-300",from:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",to:"opacity-100 translate-y-0 sm:scale-100"},leaving:{cls:"ease-in duration-200",from:"opacity-100 translate-y-0 sm:scale-100",to:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"}},v=(kt(l,()=>{xt(u,o,l.value),xt(c,d,l.value),l.value||setTimeout(()=>t("done"),200)}),l.value=!0,()=>l.value=!1),p=(ul("ModalProvider",{openModal:function(e,t){p.value=e,f.value=t}}),A()),f=A();async function m(e){f.value&&f.value(e),p.value=void 0,f.value=void 0}let y=e=>{"Escape"===e.key&&v()};return tt(()=>window.addEventListener("keydown",y)),jt(()=>window.removeEventListener("keydown",y)),(e,t)=>{var l=U("ModalLookup");return a(),i("div",{id:r.id,"data-transition-for":r.id,onMousedown:v,class:"relative z-10","aria-labelledby":r.id+"-title",role:"dialog","aria-modal":"true"},[s("div",{class:g(["fixed inset-0 bg-gray-500/75 transition-opacity",o.value])},null,2),s("div",uf,[s("div",df,[s("div",{class:g([r.modalClass,r.sizeClass,d.value]),onMousedown:t[0]||(t[0]=He(()=>{},["stop"]))},[s("div",null,[G(n).closebutton?O(e.$slots,"createform",{key:0}):(a(),i("div",cf,[s("button",{type:"button",onClick:v,class:g(r.closeButtonClass),title:"Close"},[...t[1]||(t[1]=[s("span",{class:"sr-only"},"Close",-1),s("svg",{class:"h-6 w-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],2)])),O(e.$slots,"default")])],34),O(e.$slots,"bottom")])]),"ModalLookup"==p.value?.name&&p.value.ref?(a(),X(l,{key:0,"ref-info":p.value.ref,onDone:m,configureField:r.configureField},null,8,["ref-info","configureField"])):x("",!0)],40,rf)}}}),vf={class:"pt-2 overflow-auto",style:{"min-height":"620px"}},mf={class:"mt-3 pl-5 flex flex-wrap items-center"},gf={class:"hidden sm:block text-xl leading-6 font-medium text-gray-900 dark:text-gray-50 mr-3"},pf={class:"hidden md:inline"},yf={class:"flex pb-1 sm:pb-0"},hf=["title"],bf=["disabled"],wf=["disabled"],xf=["disabled"],kf=["disabled"],Cf={key:0,class:"flex pb-1 sm:pb-0"},$f={class:"px-4 text-lg text-black dark:text-white"},Lf={key:0},Vf={key:1},Mf={key:2},Sf={key:1,class:"pl-2 mt-1"},Tf={class:"whitespace-nowrap"},Ff={key:2,class:"pl-2"},Af={class:"flex pb-1 sm:pb-0"},If={key:0,class:"pl-2"},Pf={class:"mr-1"},Df={key:0,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Bf={key:1,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},jf={key:1},Of={key:4},Hf={key:0},Rf={key:0,class:"cursor-pointer flex justify-between items-center hover:text-gray-900 dark:hover:text-gray-50"},Ef={class:"mr-1 select-none"},Nf={key:1,class:"flex justify-between items-center"},zf={class:"mr-1 select-none"},Ys=25,Uf=ue({__name:"ModalLookup",props:{id:{default:"ModalLookup"},refInfo:{},skip:{default:0},prefs:{},selectedColumns:{},allowFiltering:{type:[Boolean,null],default:!0},showPreferences:{type:[Boolean,null],default:!0},showPagingNav:{type:[Boolean,null],default:!0},showPagingInfo:{type:[Boolean,null],default:!0},showResetPreferences:{type:[Boolean,null],default:!0},showFiltersView:{type:[Boolean,null],default:!0},toolbarButtonClass:{},canFilter:{},type:{},modelTitle:{},newButtonLabel:{},configureField:{}},emits:["done"],setup(v,{emit:Q}){let p=v,l=Q,Z=Tl(),W=Ot().config,{metadataApi:e,filterDefinitions:K}=vt(),J=Ne("client"),r=W.value.storage,f=c(()=>p.toolbarButtonClass??ge.toolbarButtonClass),m=c(()=>K.value),y=A({take:Ys}),h=A(new Ge),b=A(p.skip),w=A(!1),k=A(),n=e=>"string"==typeof e?e.split(","):e||[];function Y(e,t){return ge.getTableRowClass("fullWidth",t,!1,!0)}let t=c(()=>Je(p.refInfo.model)),C=c(()=>{var e=(0<(e=n(p.selectedColumns)).length?e:[]).map(e=>e.toLowerCase());let a=et(t.value);return 0<e.length?e.map(t=>a.find(e=>e.name.toLowerCase()===t)).filter(e=>null!=e):a}),ee=c(()=>{let e=C.value.map(e=>e.name),t=n(y.value.selectedColumns).map(e=>e.toLowerCase());return 0<t.length?e.filter(e=>t.includes(e.toLowerCase())):e}),L=c(()=>y.value.take??Ys),V=c(()=>(h.value.response?ye(h.value.response,"results"):null)??[]),S=c(()=>h.value.response?.total??V.value.length??0),M=c(()=>0<b.value),F=c(()=>0<b.value),I=c(()=>V.value.length>=L.value),N=c(()=>V.value.length>=L.value),D=A([]),te=c(()=>D.value.some(e=>0<e.settings.filters.length||!!e.settings.sort)),j=c(()=>D.value.map(e=>e.settings.filters.length).reduce((e,t)=>e+t,0)),ae=c(()=>Jt(t.value)),o=c(()=>e.value?.operations.find(e=>e.dataModel?.name==p.refInfo.model&&Re.isAnyQuery(e))),le=A(),B=A(!1),$=A(),u=c(()=>Ht(p.refInfo.model)),H=c(()=>bt.forType(u.value,e.value)),P=c(()=>u.value||o.value?.dataModel.name),se=c(()=>p.modelTitle||P.value),re=c(()=>p.newButtonLabel||"New "+se.value),ne=c(()=>nl(H.value.Create)),E=A(),R=A(!1);function _(){R.value=!1}async function oe(e){_(),l("done",e)}function ie(e){E.value&&(Object.assign(E.value?.model,e),console.log("setCreate",JSON.stringify(e,null,2)),E.value?.forceUpdate(),Pe()?.proxy?.$forceUpdate())}let ue=()=>p.id+"/ApiPrefs/"+p.refInfo.model,d=e=>`Column/${p.id}:${p.refInfo.model}.`+e;async function z(e){b.value+=e,b.value<0&&(b.value=0);var t=Math.floor(S.value/L.value)*L.value;b.value>t&&(b.value=t),await q()}async function de(e,t){l("done",e)}function ce(){l("done",null)}function ve(t,e){var a,l=e.target;"TD"!==l?.tagName&&(l=l?.closest("TABLE")?.getBoundingClientRect(),a=D.value.find(e=>e.name.toLowerCase()==t.toLowerCase()))&&l&&(l=("DIV"===e.target?.tagName?e.target:e.target?.closest("DIV")).getBoundingClientRect(),$.value={column:a,topLeft:{x:Math.max(Math.floor(l.x+25),343),y:Math.floor(115)}})}function fe(){$.value=null}async function me(e){var t=$.value?.column;t&&(t.settings=e,r.setItem(d(t.name),JSON.stringify(t.settings)),await q()),$.value=null}async function be(e){r.setItem(d(e.name),JSON.stringify(e.settings)),await q()}async function xe(e){B.value=!1,y.value=e,r.setItem(ue(),JSON.stringify(e)),await q()}async function q(){var l=(()=>{let l={include:"total",take:L.value},e=n(y.value.selectedColumns||p.selectedColumns);var t;0<e.length&&((t=ae.value)&&e.includes(t.name)&&(e=[t.name,...e]),l.fields=e.join(","));let s=[];return D.value.forEach(a=>{a.settings.sort&&s.push(("DESC"===a.settings.sort?"-":"")+a.name),a.settings.filters.forEach(e=>{var t=e.key.replace("%",a.name);l[t]=e.value})}),"u"<typeof l.skip&&0<b.value&&(l.skip=b.value),0<s.length&&(l.orderBy=s.join(",")),l})(),s=o.value;if(s){let e=al(s,l),t=on(e=>{h.value.response=h.value.error=void 0,w.value=e}),a=await J.api(e);t(),wt(()=>h.value=a);s=ye(a.response,"results")||[];a.succeeded&&s.label}else console.error("No Query API was found for "+p.refInfo.model)}async function ke(){D.value.forEach(e=>{e.settings={filters:[]},r.removeItem(d(e.name))}),await q()}return tt(async()=>{var e=p.prefs||Vl(r.getItem(ue()));e&&(y.value=e),D.value=C.value.map(e=>({name:e.name,type:e.type,meta:e,settings:Object.assign({filters:[]},Vl(r.getItem(d(e.name))))})),isNaN(p.skip)||(b.value=p.skip),await q()}),(l,e)=>{let t=U("AutoCreateForm"),r=U("ErrorSummary"),n=U("Loading"),o=U("SettingsIcons"),u=U("DataGrid"),d=U("ModalDialog");return a(),i(Ve,null,[v.refInfo?(a(),X(d,{key:0,ref_key:"modalDialog",ref:le,id:v.id,onDone:ce},{default:we(()=>[s("div",vf,[s("div",mf,[s("h3",gf,[e[9]||(e[9]=he(" Select ",-1)),s("span",pf,T(G(De)(v.refInfo.model)),1)]),s("div",yf,[v.showPreferences?(a(),i("button",{key:0,type:"button",class:"pl-2 text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400",title:v.refInfo.model+" Preferences",onClick:e[0]||(e[0]=e=>B.value=!B.value)},[...e[10]||(e[10]=[s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("g",{"stroke-width":"1.5",fill:"none"},[s("path",{d:"M9 3H3.6a.6.6 0 0 0-.6.6v16.8a.6.6 0 0 0 .6.6H9M9 3v18M9 3h6M9 21h6m0-18h5.4a.6.6 0 0 1 .6.6v16.8a.6.6 0 0 1-.6.6H15m0-18v18",stroke:"currentColor"})])],-1)])],8,hf)):x("",!0),v.showPagingNav?(a(),i("button",{key:1,type:"button",class:g(["pl-2",M.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"First page",disabled:!M.value,onClick:e[1]||(e[1]=e=>z(-S.value))},[...e[11]||(e[11]=[s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6l6 6zM6 6h2v12H6z",fill:"currentColor"})],-1)])],10,bf)):x("",!0),v.showPagingNav?(a(),i("button",{key:2,type:"button",class:g(["pl-2",F.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Previous page",disabled:!F.value,onClick:e[2]||(e[2]=e=>z(-L.value))},[...e[12]||(e[12]=[s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z",fill:"currentColor"})],-1)])],10,wf)):x("",!0),v.showPagingNav?(a(),i("button",{key:3,type:"button",class:g(["pl-2",I.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Next page",disabled:!I.value,onClick:e[3]||(e[3]=e=>z(L.value))},[...e[13]||(e[13]=[s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M10 6L8.59 7.41L13.17 12l-4.58 4.59L10 18l6-6z",fill:"currentColor"})],-1)])],10,xf)):x("",!0),v.showPagingNav?(a(),i("button",{key:4,type:"button",class:g(["pl-2",N.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Last page",disabled:!N.value,onClick:e[4]||(e[4]=e=>z(S.value))},[...e[14]||(e[14]=[s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6l-6-6zM16 6h2v12h-2z",fill:"currentColor"})],-1)])],10,kf)):x("",!0)]),v.showPagingInfo?(a(),i("div",Cf,[s("div",$f,[w.value?(a(),i("span",Lf,"Querying...")):x("",!0),V.value.length?(a(),i("span",Vf,[e[15]||(e[15]=s("span",{class:"hidden xl:inline"}," Showing Results ",-1)),he(" "+T(b.value+1)+" - "+T(Math.min(b.value+V.value.length,S.value))+" ",1),s("span",null," of "+T(S.value),1)])):h.value.completed?(a(),i("span",Mf,"No Results")):x("",!0)])])):x("",!0),H.value.Create&&ne.value?(a(),i("div",Sf,[s("button",{type:"button",onClick:e[5]||(e[5]=e=>{R.value=!0}),title:"modelTitle",class:g(G(ge).toolbarButtonClass)},[e[16]||(e[16]=s("svg",{class:"w-5 h-5 mr-1 text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-50",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z",fill:"currentColor"})],-1)),s("span",Tf,T(re.value),1)],2),R.value?(a(),X(t,{key:0,ref_key:"createForm",ref:E,type:H.value.Create.request.name,configure:v.configureField,onDone:_,onSave:oe},{header:we(()=>[O(l.$slots,"formheader",{form:"create",formInstance:E.value,apis:H.value,type:P.value,updateModel:ie})]),footer:we(()=>[O(l.$slots,"formfooter",{form:"create",formInstance:E.value,apis:H.value,type:P.value,updateModel:ie})]),_:3},8,["type","configure"])):x("",!0)])):x("",!0),te.value&&v.showResetPreferences?(a(),i("div",Ff,[s("button",{type:"button",onClick:ke,title:"Reset Preferences & Filters",class:g(f.value)},[...e[17]||(e[17]=[s("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 24 24"},[s("path",{fill:"currentColor",d:"M6.78 2.72a.75.75 0 0 1 0 1.06L4.56 6h8.69a7.75 7.75 0 1 1-7.75 7.75a.75.75 0 0 1 1.5 0a6.25 6.25 0 1 0 6.25-6.25H4.56l2.22 2.22a.75.75 0 1 1-1.06 1.06l-3.5-3.5a.75.75 0 0 1 0-1.06l3.5-3.5a.75.75 0 0 1 1.06 0Z"})],-1)])],2)])):x("",!0),s("div",Af,[v.showFiltersView&&0<j.value?(a(),i("div",If,[s("button",{type:"button",onClick:e[6]||(e[6]=e=>k.value="filters"==k.value?null:"filters"),class:g(f.value),"aria-expanded":"false"},[e[20]||(e[20]=s("svg",{class:"flex-none w-5 h-5 mr-2 text-gray-400 dark:text-gray-500 group-hover:text-gray-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[s("path",{"fill-rule":"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z","clip-rule":"evenodd"})],-1)),s("span",Pf,T(j.value)+" "+T(1==j.value?"Filter":"Filters"),1),"filters"!=k.value?(a(),i("svg",Df,[...e[18]||(e[18]=[s("path",{"fill-rule":"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z","clip-rule":"evenodd"},null,-1)])])):(a(),i("svg",Bf,[...e[19]||(e[19]=[s("path",{"fill-rule":"evenodd",d:"M5 10a1 1 0 011-1h8a1 1 0 110 2H6a1 1 0 01-1-1z","clip-rule":"evenodd"},null,-1)])]))],2)])):x("",!0)])]),"filters"==k.value?(a(),X(Ds,{key:0,class:"border-y border-gray-200 dark:border-gray-800 py-8 my-2",definitions:m.value,columns:D.value,onDone:e[7]||(e[7]=e=>k.value=null),onChange:be},null,8,["definitions","columns"])):x("",!0),$.value?(a(),i("div",jf,[pe(Ps,{definitions:m.value,column:$.value.column,"top-left":$.value.topLeft,onDone:fe,onSave:me},null,8,["definitions","column","top-left"])])):x("",!0),h.value.error?(a(),X(r,{key:2,status:h.value.error},null,8,["status"])):w.value?(a(),X(n,{key:3})):(a(),i("div",Of,[V.value.length?(a(),i("div",Hf,[pe(u,{id:v.id,items:V.value,type:v.refInfo.model,"selected-columns":ee.value,onFiltersChanged:q,tableStyle:"fullWidth",rowClass:Y,onRowSelected:de,onHeaderSelected:ve},us({header:we(({column:t,label:e})=>[!v.allowFiltering||p.canFilter&&!p.canFilter(t)?(a(),i("div",Nf,[s("span",zf,T(e),1)])):(a(),i("div",Rf,[s("span",Ef,T(e),1),pe(o,{column:D.value.find(e=>e.name.toLowerCase()===t.toLowerCase()),"is-open":$.value?.column.name===t},null,8,["column","is-open"])]))]),_:2},[Se(Object.keys(G(Z)),t=>({name:t,fn:we(e=>[O(l.$slots,t,$l(ln(e)))])}))]),1032,["id","items","type","selected-columns"])])):x("",!0)]))])]),_:3},8,["id"])):x("",!0),B.value?(a(),X(Bs,{key:1,columns:C.value,prefs:y.value,onDone:e[8]||(e[8]=e=>B.value=!1),onSave:xe},null,8,["columns","prefs"])):x("",!0)],64)}}}),qf={class:"sm:hidden"},Qf=["for"],Kf=["id","name"],_f=["value"],Zf={class:"hidden sm:block"},Wf={class:"border-b border-gray-200"},Gf={class:"-mb-px flex","aria-label":"Tabs"},Jf=["onClick"],Xf=ue({__name:"Tabs",props:{tabs:{},id:{default:"tabs"},param:{default:"tab"},label:{type:Function,default:e=>De(e)},selected:{},tabClass:{},bodyClass:{default:"p-4"},url:{type:Boolean,default:!0},clearQuery:{type:Boolean,default:!1}},setup(l){let t=l,r=c(()=>Object.keys(t.tabs)),n=e=>t.label?t.label(e):De(e),o=c(()=>t.id||"tabs"),u=c(()=>t.param||"tab"),d=A();function v(e){d.value=e,t.url&&Ms({tab:e===r.value[0]?void 0:e},t.clearQuery)}let p=c(()=>100/Object.keys(t.tabs).length+"%");return tt(()=>{var e;d.value=t.selected||Object.keys(t.tabs)[0],t.url&&(e=location.search||(location.hash.includes("?")?"?"+bl(location.hash,"?"):""),e=Gl(e)[u.value])&&(d.value=e)}),(e,t)=>(a(),i("div",null,[s("div",qf,[s("label",{for:o.value,class:"sr-only"},"Select a tab",8,Qf),s("select",{id:o.value,name:o.value,class:"block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500",onChange:t[0]||(t[0]=e=>v(e.target?.value))},[(a(!0),i(Ve,null,Se(r.value,e=>(a(),i("option",{key:e,value:e},T(n(e)),9,_f))),128))],40,Kf)]),s("div",Zf,[s("div",Wf,[s("nav",Gf,[(a(!0),i(Ve,null,Se(r.value,t=>{return a(),i("a",{href:"#",onClick:He(e=>v(t),["prevent"]),style:is({width:p.value}),class:g([(e=t,d.value===e?"border-indigo-500 text-indigo-600 py-4 px-1 text-center border-b-2 font-medium text-sm":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 py-4 px-1 text-center border-b-2 font-medium text-sm"),l.tabClass])},T(n(t)),15,Jf);var e}),256))])])]),s("div",{class:g(l.bodyClass)},[(a(),X(sn(l.tabs[d.value])))],2)]))}}),Yf=ue({__name:"DarkModeToggle",setup(e){let l=typeof document<"u"?document.documentElement:null,r=()=>!!l?.classList.contains("dark"),n=A("dark"==localStorage.getItem("color-scheme"));return(e,t)=>(a(),i("button",{type:"button",class:"bg-gray-200 dark:bg-gray-700 relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black",role:"switch","aria-checked":"false",onClick:t[0]||(t[0]=e=>{r()?l?.classList.remove("dark"):l?.classList.add("dark"),n.value=r(),localStorage.setItem("color-scheme",n.value?"dark":"light")})},[s("span",{class:g(`${n.value?"translate-x-0":"translate-x-5"} pointer-events-none relative inline-block h-5 w-5 rounded-full bg-white dark:bg-black shadow transform ring-0 transition ease-in-out duration-200`)},[s("span",{class:g(`${n.value?"opacity-100 ease-in duration-200":"opacity-0 ease-out duration-100"} absolute inset-0 h-full w-full flex items-center justify-center transition-opacity`),"aria-hidden":"true"},[...t[1]||(t[1]=[s("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4 text-gray-400",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32"},[s("path",{fill:"currentColor",d:"M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3Z"})],-1)])],2),s("span",{class:g(`${n.value?"opacity-0 ease-out duration-100":"opacity-100 ease-in duration-200"} absolute inset-0 h-full w-full flex items-center justify-center transition-opacity`),"aria-hidden":"true"},[...t[2]||(t[2]=[s("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4 text-indigo-600",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32"},[s("path",{fill:"currentColor",d:"M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6ZM5.394 6.813L6.81 5.399l3.505 3.506L8.9 10.319zM2 15.005h5v2H2zm3.394 10.193L8.9 21.692l1.414 1.414l-3.505 3.506zM15 25.005h2v5h-2zm6.687-1.9l1.414-1.414l3.506 3.506l-1.414 1.414zm3.313-8.1h5v2h-5zm-3.313-6.101l3.506-3.506l1.414 1.414l-3.506 3.506zM15 2.005h2v5h-2z"})],-1)])],2)],2)]))}}),ev={key:0},tv={key:1,class:"min-h-full flex flex-col justify-center py-12 sm:px-6 lg:px-8"},lv={class:"sm:mx-auto sm:w-full sm:max-w-md"},sv={class:"mt-6 text-center text-3xl font-extrabold text-gray-900 dark:text-gray-50"},nv={key:0,class:"mt-4 text-center text-sm text-gray-600 dark:text-gray-300"},av={class:"relative z-0 inline-flex shadow-sm rounded-md"},ov=["onClick"],iv={class:"mt-8 sm:mx-auto sm:w-full sm:max-w-md"},rv={class:"bg-white dark:bg-black py-8 px-4 shadow sm:rounded-lg sm:px-10"},uv={class:"mt-8"},dv={key:1,class:"mt-6"},cv={class:"mt-6 grid grid-cols-3 gap-3"},fv=["href","title"],vv={key:1,class:"h-5 w-5 text-gray-700 dark:text-gray-200",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},mv=ue({__name:"SignIn",props:{provider:{},title:{default:"Sign In"},tabs:{type:[Boolean,String],default:!0},oauth:{type:[Boolean,String],default:!0}},emits:["login"],setup(d,{emit:e}){let l=d,t=e,{getMetadata:r,createDto:n}=vt(),o=fl(),u=Ne("client"),v=Is().signIn,p=r({assert:!0}),f=p.plugins.auth,m=document.baseURI,y=p.app.baseUrl,h=A(n("Authenticate")),b=A(new Ge),w=A(l.provider),k=(tt(()=>{f?.authProviders.map(e=>e.formLayout).filter(e=>e).forEach(e=>e.forEach(e=>h.value[e.id]="checkbox"!==e.type&&""))}),c(()=>f?.authProviders.filter(e=>e.formLayout)||[])),C=c(()=>k.value[0]||{}),L=c(()=>k.value[Math.max(k.value.length-1,0)]||{}),V=c(()=>(w.value?f?.authProviders.find(e=>e.name===w.value):null)??C.value),S=e=>!1===e||"false"===e;function M(e){return e.label||e.navItem&&e.navItem.label}let O=c(()=>(V.value?.formLayout||[]).map(e=>Object.assign({},e,{type:e.type?.toLowerCase(),autocomplete:e.autocomplete||("password"===e.type?.toLowerCase()?"current-password":void 0)||("username"===e.id.toLowerCase()?"username":void 0),css:Object.assign({field:"col-span-12"},e.css)}))),F=c(()=>!S(l.oauth)&&f?.authProviders.filter(e=>"oauth"===e.type)||[]),I=c(()=>{let e=Pa(f?.authProviders.filter(e=>e.formLayout&&0<e.formLayout.length),(e,t)=>{e[M(t)||ut(t.name)]=t.name===C.value.name?"":t.name});var t=V.value;return e=t&&S(l.tabs)?{[M(t)||ut(t.name)]:t}:e}),N=c(()=>{var e=O.value.map(e=>e.id).filter(e=>e);return b.value.summaryMessage(e)});async function D(){var e;h.value.provider=V.value.name,"authsecret"===V.value.name?(u.headers.set("authsecret",h.value.authsecret),h.value=n("Authenticate")):"basic"===V.value.name?(u.setCredentials(h.value.UserName,h.value.Password),h.value=n("Authenticate"),h.value.UserName=null,h.value.Password=null):"Bearer"!==V.value.type&&"jwt"!==V.value.name||(u.bearerToken=h.value.BearerToken,h.value=n("Authenticate")),b.value=await o.api(h.value),b.value.succeeded&&(e=b.value.response,v(e),t("login",e),b.value=new Ge,h.value=n("Authenticate"))}return(e,t)=>{let l=U("ErrorSummary"),r=U("AutoFormFields"),n=U("PrimaryButton"),o=U("Icon"),u=pa("href");return G(f)?(a(),i("div",tv,[s("div",lv,[s("h2",sv,T(d.title),1),1<Object.keys(I.value).length?(a(),i("p",nv,[s("span",av,[(a(!0),i(Ve,null,Se(I.value,(t,e)=>Pt((a(),i("a",{onClick:e=>w.value=t,class:g([""===t||t===L.value.name?"rounded-l-md":t===L.value.name?"rounded-r-md -ml-px":"-ml-px",w.value===t?"z-10 outline-none ring-1 ring-indigo-500 border-indigo-500":"","cursor-pointer relative inline-flex items-center px-4 py-1 border border-gray-300 dark:border-gray-600 bg-white dark:bg-black text-sm font-medium text-gray-700 dark:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-900"])},[he(T(e),1)],10,ov)),[[u,{provider:t}]])),256))])])):x("",!0)]),s("div",iv,[N.value?(a(),X(l,{key:0,class:"mb-3",errorSummary:N.value},null,8,["errorSummary"])):x("",!0),s("div",rv,[O.value.length?(a(),i("form",{key:0,onSubmit:He(D,["prevent"])},[pe(r,{modelValue:h.value,formLayout:O.value,api:b.value,hideSummary:!0,"divide-class":"","space-class":"space-y-6"},null,8,["modelValue","formLayout","api"]),s("div",uv,[pe(n,{class:"w-full"},{default:we(()=>[...t[0]||(t[0]=[he("Sign In",-1)])]),_:1})])],32)):x("",!0),F.value.length?(a(),i("div",dv,[t[2]||(t[2]=Sl('<div class="relative"><div class="absolute inset-0 flex items-center"><div class="w-full border-t border-gray-300 dark:border-gray-600"></div></div><div class="relative flex justify-center text-sm"><span class="px-2 bg-white text-gray-500 dark:text-gray-400"> Or continue with </span></div></div>',1)),s("div",cv,[(a(!0),i(Ve,null,Se(F.value,e=>(a(),i("div",null,[s("a",{href:G(y)+e.navItem.href+"?continue="+G(m),title:M(e),class:"w-full inline-flex justify-center py-2 px-4 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm bg-white dark:bg-black text-sm font-medium text-gray-500 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-900"},[e.icon?(a(),X(o,{key:0,image:e.icon,class:"h-5 w-5 text-gray-700 dark:text-gray-200"},null,8,["image"])):(a(),i("svg",vv,[...t[1]||(t[1]=[s("path",{d:"M16 8a5 5 0 1 0 5 5a5 5 0 0 0-5-5z",fill:"currentColor"},null,-1),s("path",{d:"M16 2a14 14 0 1 0 14 14A14.016 14.016 0 0 0 16 2zm7.992 22.926A5.002 5.002 0 0 0 19 20h-6a5.002 5.002 0 0 0-4.992 4.926a12 12 0 1 1 15.985 0z",fill:"currentColor"},null,-1)])]))],8,fv)]))),256))])])):x("",!0)])])])):(a(),i("div",ev,"No Auth Plugin"))}}}),gv=["for"],pv={key:1,class:"border border-gray-200 flex justify-between shadow-sm"},yv={class:"p-2 flex flex-wrap gap-x-4"},hv={key:0,class:"p-2 flex flex-wrap gap-x-4"},bv=["href"],wv={class:""},xv=["name","id","label","value","rows","disabled"],kv=["id"],Cv=["id"],Ye="w-5 h-5 cursor-pointer select-none text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400",$v=ue({__name:"MarkdownInput",props:{status:{},id:{},inputClass:{},filterClass:{},label:{},labelClass:{},help:{},placeholder:{},modelValue:{},counter:{type:Boolean},rows:{},errorMessages:{},lang:{},autoFocus:{type:Boolean},disabled:{type:Boolean},helpUrl:{default:"https://guides.github.com/features/mastering-markdown/"},hide:{}},emits:["update:modelValue","close"],setup(l,{expose:e,emit:t}){let r=l,n=t,y=[],h=[],o=Ne("ApiState",void 0),u=c(()=>pt.call({responseStatus:r.status??o?.error.value},r.id)),d=c(()=>r.label??De(ut(r.id))),v="bold,italics,link,image,blockquote,code,heading,orderedList,unorderedList,strikethrough,undo,redo,help".split(","),p=c(()=>r.hide?At(v,r.hide):At(v,[]));function f(e){return p.value[e]}let m=c(()=>Ct(["shadow-sm font-mono"+rt.base.replace("rounded-md",""),u.value?"text-red-900 focus:ring-red-500 focus:border-red-500 border-red-300":"text-gray-900 "+rt.valid,r.inputClass],"MarkdownInput",r.filterClass)),b=A();function w(e){n("update:modelValue",e)}function k(){return b.value.selectionStart!==b.value.selectionEnd}function C(){var e=b.value;return e.value.substring(e.selectionStart,e.selectionEnd)||""}function L(){var e=b.value,t=e.value,a=e.selectionStart,e=t.substring(a,e.selectionEnd)||"",l=t.substring(0,a),s=l.lastIndexOf(`
`);return{value:t,sel:e,selPos:a,beforeSel:l,afterSel:t.substring(a),prevCRPos:s,beforeCR:0<=s?l.substring(0,s+1):"",afterCR:0<=s?l.substring(s+1):""}}function V({value:e,selectionStart:t,selectionEnd:a}){null==a&&(a=t),w(e),wt(()=>{b.value.focus(),b.value.setSelectionRange(t,a)})}function S(e,t,a="",{selectionAtEnd:l,offsetStart:s,offsetEnd:r,filterValue:n,filterSelection:o}={}){let i=b.value,u=i.value,d=i.selectionEnd;y.push({value:u,selectionStart:i.selectionStart,selectionEnd:i.selectionEnd}),h=[];var c,v=i.selectionStart,p=i.selectionEnd,f=u.substring(0,v),m=u.substring(p),g=e&&f.endsWith(e)&&m.startsWith(t);v==p?(g?(u=f.substring(0,f.length-e.length)+m.substring(t.length),d+=-t.length):(u=f+e+a+t+m,d+=e.length,s=0,r=a?.length||0,l&&(d+=r,r=0)),n&&(c={pos:d},u=n(u,c),d=c.pos)):(c=u.substring(v,p),o&&(c=o(c)),g?(u=f.substring(0,f.length-e.length)+c+m.substring(t.length),s=-c.length-e.length,r=c.length):(u=f+e+c+t+m,s?d+=(e+t).length:(d=v,s=e.length,r=c.length))),w(u),wt(()=>{i.focus(),s=d+(s||0),r=(s||0)+(r||0),i.setSelectionRange(s,r)})}e({props:r,textarea:b,updateModelValue:w,selection:C,hasSelection:k,selectionInfo:L,insert:S,replace:V});let M=()=>S("**","**","bold"),F=()=>S("_","_","italics"),I=()=>S("~~","~~","strikethrough"),N=()=>S("[","](https://)","",{offsetStart:-9,offsetEnd:8}),D=()=>S(`
> `,`
`,"Blockquote",{}),j=()=>S("![](",")");function B(e){var t,a=C();a&&!e.shiftKey?S("`","`","code"):(t=r.lang||"js",-1===a.indexOf(`
`)?S("\n```"+t+`
`,"\n```\n","// code"):S("```"+t+`
`,"```\n",""))}function $(){if(k()){let{sel:e,beforeSel:l,afterSel:s,prevCRPos:r,beforeCR:n,afterCR:o}=L();if(-1===e.indexOf(`
`))S(`
 1. `,`
`);else if(e.startsWith(" 1. "))S("","","",{filterValue:(e,t)=>{var a;return 0<=r&&(a=o.replace(/^ - /,""),l=n+a,t.pos-=o.length-a.length),l+s},filterSelection:e=>e.replace(/^ 1. /g,"").replace(/\n \d+. /g,`
`)});else{let t=1;S("",""," - ",{selectionAtEnd:!0,filterSelection:e=>" 1. "+e.replace(/\n$/,"").replace(/\n/g,e=>`
 ${++t}. `)+`
`})}}else S(`
 1. `,`
`,"List Item",{offsetStart:-10,offsetEnd:9})}function H(){if(k()){let{sel:e,beforeSel:l,afterSel:s,prevCRPos:r,beforeCR:n,afterCR:o}=L();-1===e.indexOf(`
`)?S(`
 - `,`
`):e.startsWith(" - ")?S("","","",{filterValue:(e,t)=>{var a;return 0<=r&&(a=o.replace(/^ - /,""),l=n+a,t.pos-=o.length-a.length),l+s},filterSelection:e=>e.replace(/^ - /g,"").replace(/\n - /g,`
`)}):S("",""," - ",{selectionAtEnd:!0,filterSelection:e=>" - "+e.replace(/\n$/,"").replace(/\n/g,`
 - `)+`
`})}else S(`
 - `,`
`,"List Item",{offsetStart:-10,offsetEnd:9})}function P(){var e=C(),t=-1===e.indexOf(`
`);e?t?S(`
## `,`
`,""):S("## ","",""):S(`
## `,`
`,"Heading",{offsetStart:-8,offsetEnd:7})}function E(){var e,t;return 0!==y.length&&(e=b.value,t=y.pop(),h.push({value:e.value,selectionStart:e.selectionStart,selectionEnd:e.selectionEnd}),V(t),!0)}function U(){var e,t;return 0!==h.length&&(e=b.value,t=h.pop(),y.push({value:e.value,selectionStart:e.selectionStart,selectionEnd:e.selectionEnd}),V(t),!0)}let R=()=>null;return tt(()=>{y=[],h=[],b.value.onkeydown=e=>{if("Escape"===e.key||27===e.keyCode)n("close");else{var t=String.fromCharCode(e.keyCode).toLowerCase();if("\t"===t)e.shiftKey?S("","","",{filterValue:(e,t)=>{let{beforeSel:a,afterSel:l,prevCRPos:s,beforeCR:r,afterCR:n}=L();var o;return 0<=s&&(o=n.replace(/\t/g,"    ").replace(/^ ? ? ? ?/,""),a=r+o,t.pos-=n.length-o.length),a+l},filterSelection:e=>e.replace(/\t/g,"    ").replace(/^ ? ? ? ?/g,"").replace(/\n    /g,`
`)}):S("","","    ",{selectionAtEnd:!0,filterSelection:e=>"    "+e.replace(/\n$/,"").replace(/\n/g,`
    `)+`
`}),e.preventDefault();else if(e.ctrlKey)if("z"===t)e.shiftKey?U()&&e.preventDefault():E()&&e.preventDefault();else if("b"!==t||e.shiftKey)if("h"!==t||e.shiftKey)if("i"!==t||e.shiftKey)if("q"!==t||e.shiftKey)if("k"===t)(e.shiftKey?j:N)(),e.preventDefault();else if(","===t||"<"===e.key||">"===e.key||188===e.keyCode)B(e),e.preventDefault();else if("/"!==t&&"/"!==e.key)"?"!==t&&"?"!==e.key||!e.shiftKey||(S(`/*
`,`*/
`,""),e.preventDefault());else{{let{sel:e,selPos:t,beforeSel:l,afterSel:s,prevCRPos:r,beforeCR:n,afterCR:o}=L();e.startsWith("//")||o.startsWith("//")?S("","","",{filterValue:(e,t)=>{var a;return 0<=r&&(a=o.replace(/^\/\//,""),l=n+a,t.pos-=o.length-a.length),l+s},filterSelection:e=>e.replace(/^\/\//g,"").replace(/\n\/\//g,`
`)}):e?S("","","//",{selectionAtEnd:!0,filterSelection:e=>"//"+e.replace(/\n$/,"").replace(/\n/g,`
//`)+`
`}):V({value:n+"//"+o+s,selectionStart:t+2})}e.preventDefault()}else D(),e.preventDefault();else F(),e.preventDefault();else P(),e.preventDefault();else M(),e.preventDefault();else e.altKey&&("1"===e.key||"0"===e.key?($(),e.preventDefault()):"-"===e.key?(H(),e.preventDefault()):"s"===e.key&&(I(),e.preventDefault()))}}}),(e,t)=>(a(),i("div",null,[O(e.$slots,"header",Ce({inputElement:b.value,id:l.id,modelValue:l.modelValue,status:l.status},e.$attrs)),d.value?(a(),i("label",{key:0,for:l.id,class:g("mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300 "+(l.labelClass??""))},T(d.value),11,gv)):x("",!0),l.disabled?x("",!0):(a(),i("div",pv,[s("div",yv,[f("bold")?(a(),i("svg",{key:0,class:g(Ye),onClick:M,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[...t[1]||(t[1]=[s("title",null,"Bold text (CTRL+B)",-1),s("path",{fill:"currentColor",d:"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79c0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79c0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z"},null,-1)])])):x("",!0),f("italics")?(a(),i("svg",{key:1,class:g(Ye),onClick:F,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[...t[2]||(t[2]=[s("title",null,"Italics (CTRL+I)",-1),s("path",{fill:"currentColor",d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4h-8z"},null,-1)])])):x("",!0),f("link")?(a(),i("svg",{key:2,class:g(Ye),onClick:N,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[...t[3]||(t[3]=[s("title",null,"Insert Link (CTRL+K)",-1),s("path",{fill:"currentColor",d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7a5 5 0 0 0-5 5a5 5 0 0 0 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8v2m9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1c0 1.71-1.39 3.1-3.1 3.1h-4V17h4a5 5 0 0 0 5-5a5 5 0 0 0-5-5Z"},null,-1)])])):x("",!0),f("blockquote")?(a(),i("svg",{key:3,class:g(Ye),onClick:D,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[...t[4]||(t[4]=[s("title",null,"Blockquote (CTRL+Q)",-1),s("path",{fill:"currentColor",d:"m15 17l2-4h-4V6h7v7l-2 4h-3Zm-9 0l2-4H4V6h7v7l-2 4H6Z"},null,-1)])])):x("",!0),f("image")?(a(),i("svg",{key:4,class:g(Ye),onClick:j,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[...t[5]||(t[5]=[s("title",null,"Insert Image (CTRL+SHIFT+L)",-1),s("path",{fill:"currentColor",d:"M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993H2.992ZM20 15V5H4v14L14 9l6 6Zm0 2.828l-6-6L6.828 19H20v-1.172ZM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4Z"},null,-1)])])):x("",!0),f("code")?(a(),i("svg",{key:5,class:g(Ye),onClick:B,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[...t[6]||(t[6]=[s("title",null,"Insert Code (CTRL+<)",-1),s("path",{fill:"currentColor",d:"m8 18l-6-6l6-6l1.425 1.425l-4.6 4.6L9.4 16.6L8 18Zm8 0l-1.425-1.425l4.6-4.6L14.6 7.4L16 6l6 6l-6 6Z"},null,-1)])])):x("",!0),f("heading")?(a(),i("svg",{key:6,class:g(Ye),onClick:P,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[...t[7]||(t[7]=[s("title",null,"H2 Heading (CTRL+H)",-1),s("path",{fill:"currentColor",d:"M7 20V7H2V4h13v3h-5v13H7Zm9 0v-8h-3V9h9v3h-3v8h-3Z"},null,-1)])])):x("",!0),f("orderedList")?(a(),i("svg",{key:7,class:g(Ye),icon:"",onClick:$,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[...t[8]||(t[8]=[s("title",null,"Numbered List (ALT+1)",-1),s("path",{fill:"currentColor",d:"M3 22v-1.5h2.5v-.75H4v-1.5h1.5v-.75H3V16h3q.425 0 .713.288T7 17v1q0 .425-.288.713T6 19q.425 0 .713.288T7 20v1q0 .425-.288.713T6 22H3Zm0-7v-2.75q0-.425.288-.713T4 11.25h1.5v-.75H3V9h3q.425 0 .713.288T7 10v1.75q0 .425-.288.713T6 12.75H4.5v.75H7V15H3Zm1.5-7V3.5H3V2h3v6H4.5ZM9 19v-2h12v2H9Zm0-6v-2h12v2H9Zm0-6V5h12v2H9Z"},null,-1)])])):x("",!0),f("unorderedList")?(a(),i("svg",{key:8,class:g(Ye),onClick:H,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[...t[9]||(t[9]=[s("title",null,"Bulleted List (ALT+-)",-1),s("path",{fill:"currentColor",d:"M9 19v-2h12v2H9Zm0-6v-2h12v2H9Zm0-6V5h12v2H9ZM5 20q-.825 0-1.413-.588T3 18q0-.825.588-1.413T5 16q.825 0 1.413.588T7 18q0 .825-.588 1.413T5 20Zm0-6q-.825 0-1.413-.588T3 12q0-.825.588-1.413T5 10q.825 0 1.413.588T7 12q0 .825-.588 1.413T5 14Zm0-6q-.825 0-1.413-.588T3 6q0-.825.588-1.413T5 4q.825 0 1.413.588T7 6q0 .825-.588 1.413T5 8Z"},null,-1)])])):x("",!0),f("strikethrough")?(a(),i("svg",{key:9,class:g(Ye),onClick:I,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[...t[10]||(t[10]=[s("title",null,"Strike Through (ALT+S)",-1),s("path",{fill:"currentColor",d:"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"},null,-1)])])):x("",!0),f("undo")?(a(),i("svg",{key:10,class:g(Ye),onClick:E,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[...t[11]||(t[11]=[s("title",null,"Undo (CTRL+Z)",-1),s("path",{fill:"currentColor",d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88c3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"},null,-1)])])):x("",!0),f("redo")?(a(),i("svg",{key:11,class:g(Ye),onClick:U,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[...t[12]||(t[12]=[s("title",null,"Redo (CTRL+SHIFT+Z)",-1),s("path",{fill:"currentColor",d:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 0 1 7.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"},null,-1)])])):x("",!0),O(e.$slots,"toolbarbuttons",{instance:Pe()?.exposed})]),f("help")&&l.helpUrl?(a(),i("div",hv,[s("a",{title:"formatting help",target:"_blank",href:l.helpUrl,tabindex:"-1"},[(a(),i("svg",{class:g(Ye),xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[...t[13]||(t[13]=[s("path",{fill:"currentColor",d:"M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8s8 3.59 8 8s-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5c0-2.21-1.79-4-4-4z"},null,-1)])]))],8,bv)])):x("",!0)])),s("div",wv,[s("textarea",{ref_key:"txt",ref:b,name:l.id,id:l.id,class:g(m.value),label:l.label,value:l.modelValue,rows:l.rows||6,disabled:l.disabled,onInput:t[0]||(t[0]=e=>w(e.target?.value||"")),onKeydown:tn(R,["tab"])},null,42,xv)]),u.value?(a(),i("p",{key:2,class:"mt-2 text-sm text-red-500",id:l.id+"-error"},T(u.value),9,kv)):l.help?(a(),i("p",{key:3,class:"mt-2 text-sm text-gray-500",id:l.id+"-description"},T(l.help),9,Cv)):x("",!0),O(e.$slots,"footer",Ce({inputElement:b.value,id:l.id,modelValue:l.modelValue,status:l.status},e.$attrs))]))}}),Lv={key:0,class:"relative z-10 lg:hidden",role:"dialog","aria-modal":"true"},Vv={class:"fixed inset-0 flex"},Mv={class:"flex grow flex-col gap-y-5 overflow-y-auto bg-white dark:bg-black px-6 pb-2"},Sv={class:"hidden lg:fixed lg:inset-y-0 lg:z-10 lg:flex lg:w-72 lg:flex-col"},Tv={class:"flex grow flex-col gap-y-5 overflow-y-auto border-r border-gray-200 dark:border-gray-700 bg-white dark:bg-black px-6"},Fv={class:g(["sticky top-0 flex items-center gap-x-6 bg-white dark:bg-black px-4 py-4 shadow-sm sm:px-6 lg:hidden"])},Av=ue({__name:"SidebarLayout",setup(e,{expose:t}){let l=Gn().transition,r=A(!0),n=A(""),o={entering:{cls:"transition-opacity ease-linear duration-300",from:"opacity-0",to:"opacity-100"},leaving:{cls:"transition-opacity ease-linear duration-300",from:"opacity-100",to:"opacity-0"}},u=A(""),d={entering:{cls:"transition ease-in-out duration-300 transform",from:"-translate-x-full",to:"translate-x-0"},leaving:{cls:"transition ease-in-out duration-300 transform",from:"translate-x-0",to:"-translate-x-full"}},c=A(""),v={entering:{cls:"ease-in-out duration-300",from:"opacity-0",to:"opacity-100"},leaving:{cls:"ease-in-out duration-300",from:"opacity-100",to:"opacity-0"}};function p(e){l(o,n,e),l(d,u,e),l(v,c,e),setTimeout(()=>r.value=e,300)}function f(){p(!0)}function m(){p(!1)}return t({show:f,hide:m,toggle:p}),(e,t)=>(a(),i("div",null,[r.value?(a(),i("div",Lv,[s("div",{class:g(["fixed inset-0 bg-gray-900/80",n.value])},null,2),s("div",Vv,[s("div",{class:g(["relative mr-16 flex w-full max-w-xs flex-1",u.value])},[s("div",{class:g(["absolute left-full top-0 flex w-16 justify-center pt-5",c.value])},[s("button",{type:"button",onClick:m,class:"-m-2.5 p-2.5"},[...t[0]||(t[0]=[s("span",{class:"sr-only"},"Close sidebar",-1),s("svg",{class:"h-6 w-6 text-white dark:text-black",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)])])],2),s("div",Mv,[O(e.$slots,"default")])],2)])])):x("",!0),s("div",Sv,[s("div",Tv,[O(e.$slots,"default")])]),s("div",Fv,[s("button",{type:"button",onClick:f,class:"-m-2.5 p-2.5 text-gray-700 dark:text-gray-200 lg:hidden"},[...t[1]||(t[1]=[s("span",{class:"sr-only"},"Open sidebar",-1),s("svg",{class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})],-1)])]),O(e.$slots,"mobiletitlebar")])]))}}),Iv=Ho,Pv=Ko,Dv=Go,Bv=Xo,jv=Yn,Ov=ti,Hv=ni,Rv=ii,Ev=di,Nv=ci,zv=pi,Uv=wi,qv=Ci,Qv=Ii,Kv=ou,_v=cu,Zv=Ds,Wv=Ps,Gv=Bs,Jv=ea,Xv=fu,Yv=bu,em=Vu,tm=Iu,lm=Eu,sm=nd,nm=Ld,am=Bd,om=Hd,im=Rd,rm=Jd,um=Xd,dm=yc,cm=jc,fm=t0,vm=h0,mm=b0,gm=C0,pm=S0,ym=T0,hm=B0,bm=R0,wm=z0,xm=U0,km=K0,Cm=of,$m=ff,Lm=Uf,Vm=Xf,Mm=Yf,Sm=mv,Tm=$v,Fm=Av,Am={Alert:Iv,AlertSuccess:Pv,ErrorSummary:Dv,InputDescription:Bv,Icon:jv,Loading:Ov,OutlineButton:Hv,PrimaryButton:Rv,SecondaryButton:Ev,TextLink:Nv,Breadcrumbs:zv,Breadcrumb:Uv,NavList:qv,NavListItem:Qv,AutoQueryGrid:Kv,SettingsIcons:_v,FilterViews:Zv,FilterColumn:Wv,QueryPrefs:Gv,EnsureAccess:Jv,EnsureAccessDialog:Xv,TextInput:Yv,TextareaInput:em,SelectInput:tm,CheckboxInput:lm,TagInput:sm,FileInput:nm,Autocomplete:am,Combobox:om,DynamicInput:im,LookupInput:rm,AutoFormFields:um,AutoForm:dm,AutoCreateForm:cm,AutoEditForm:fm,AutoViewForm:vm,ConfirmDelete:mm,FormLoading:gm,DataGrid:pm,CellFormat:ym,PreviewFormat:hm,HtmlFormat:bm,MarkupFormat:wm,MarkupModel:xm,CloseButton:km,SlideOver:Cm,ModalDialog:$m,ModalLookup:Lm,Tabs:Vm,DarkModeToggle:Mm,SignIn:Sm,MarkdownInput:Tm,SidebarLayout:Fm},_l=Am||{},jm={install(t){function a(t){var e=Object.keys(t).filter(e=>t[e]).map(e=>encodeURIComponent(e)+"="+encodeURIComponent(t[e])).join("&");return e?"?"+e:"./"}Object.keys(_l).forEach(e=>{t.component(e,_l[e])}),t.directive("href",function(e,t){e.href=a(t.value),e.onclick=e=>{e.preventDefault(),history.pushState(t.value,"",a(t.value))}})},component(e,t){return e?t?N.components[e]=t:N.components[e]||_l[e]||null:null}};export{Iv as Alert,Pv as AlertSuccess,cm as AutoCreateForm,fm as AutoEditForm,dm as AutoForm,um as AutoFormFields,Kv as AutoQueryGrid,vm as AutoViewForm,am as Autocomplete,Uv as Breadcrumb,zv as Breadcrumbs,ym as CellFormat,lm as CheckboxInput,km as CloseButton,om as Combobox,Am as Components,mm as ConfirmDelete,Mm as DarkModeToggle,pm as DataGrid,im as DynamicInput,Jv as EnsureAccess,Xv as EnsureAccessDialog,Dv as ErrorSummary,nm as FileInput,Wv as FilterColumn,Zv as FilterViews,gm as FormLoading,bm as HtmlFormat,jv as Icon,Bv as InputDescription,Ov as Loading,rm as LookupInput,Tm as MarkdownInput,wm as MarkupFormat,xm as MarkupModel,Ra as MetadataApp,$m as ModalDialog,Lm as ModalLookup,qv as NavList,Qv as NavListItem,Hv as OutlineButton,hm as PreviewFormat,Rv as PrimaryButton,Gv as QueryPrefs,Ev as SecondaryButton,tm as SelectInput,_v as SettingsIcons,Fm as SidebarLayout,Sm as SignIn,Cm as SlideOver,Vm as Tabs,sm as TagInput,Yv as TextInput,Nv as TextLink,em as TextareaInput,Bm as css,jm as default,Is as useAuth,fl as useClient,Ot as useConfig,Ha as useFiles,Dm as useFormatters,vt as useMetadata,Gn as useUtils};